I don't know why this happened

This commit is contained in:
Jaime Passos 2020-01-24 00:35:51 -03:00
parent 686d8e418e
commit 0246026ade
5 changed files with 162 additions and 193 deletions

View file

@ -2107,7 +2107,12 @@ void CV_SaveVariables(FILE *f)
// Silly hack for Min/Max vars
if (!strcmp(cvar->string, "MAX") || !strcmp(cvar->string, "MIN"))
{
if (cvar->flags & CV_FLOAT)
sprintf(stringtowrite, "%f", FIXED_TO_FLOAT(cvar->value));
else
sprintf(stringtowrite, "%d", cvar->value);
}
else
strcpy(stringtowrite, cvar->string);

View file

@ -681,17 +681,6 @@ static int lib_pSpawnPlayerMissile(lua_State *L)
return 1;
}
static int lib_pRailThinker(lua_State *L)
{
mobj_t *mobj = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
NOHUD
INLEVEL
if (!mobj)
return LUA_ErrInvalid(L, "mobj_t");
lua_pushboolean(L, P_RailThinker(mobj));
return 1;
}
static int lib_pMobjFlip(lua_State *L)
{
mobj_t *mobj = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
@ -1417,19 +1406,6 @@ static int lib_pTeleportMove(lua_State *L)
return 2;
}
static int lib_pCheckMoveBlocked(lua_State *L)
{
line_t *li = luaL_checkudata(L, 1, META_LINE);
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 2, META_MOBJ));
INLEVEL
if (!li)
return LUA_ErrInvalid(L, "line_t");
if (!mo)
return LUA_ErrInvalid(L, "mobj_t");
lua_pushboolean(L, P_CheckMoveBlocked(li, mo));
return 1;
}
static int lib_pSlideMove(lua_State *L)
{
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
@ -3041,7 +3017,6 @@ static luaL_Reg lib[] = {
{"P_ColorTeamMissile",lib_pColorTeamMissile},
{"P_SPMAngle",lib_pSPMAngle},
{"P_SpawnPlayerMissile",lib_pSpawnPlayerMissile},
{"P_RailThinker",lib_pRailThinker},
{"P_MobjFlip",lib_pMobjFlip},
{"P_GetMobjGravity",lib_pGetMobjGravity},
{"P_WeaponOrPanel",lib_pWeaponOrPanel},
@ -3104,7 +3079,6 @@ static luaL_Reg lib[] = {
{"P_TryMove",lib_pTryMove},
{"P_Move",lib_pMove},
{"P_TeleportMove",lib_pTeleportMove},
{"P_CheckMoveBlocked",lib_pCheckMoveBlocked},
{"P_SlideMove",lib_pSlideMove},
{"P_BounceMove",lib_pBounceMove},
{"P_CheckSight", lib_pCheckSight},

View file

@ -405,7 +405,6 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam);
boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff);
boolean P_Move(mobj_t *actor, fixed_t speed);
boolean P_TeleportMove(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z);
boolean P_CheckMoveBlocked(line_t *li, mobj_t *mo);
void P_SlideMove(mobj_t *mo);
void P_BounceMove(mobj_t *mo);
boolean P_CheckSight(mobj_t *t1, mobj_t *t2);

View file

@ -3385,45 +3385,6 @@ static boolean P_IsClimbingValid(player_t *player, angle_t angle)
return false;
}
//
//P_CheckMoveBlocked
//
boolean P_CheckMoveBlocked(line_t *li, mobj_t *mo)
{
// one-sided linedefs are always solid to sliding movement.
// one-sided linedef
if (!li->backsector)
{
if (P_PointOnLineSide(mo->x, mo->y, li))
return true; // don't hit the back side
return false;
}
if (!(mo->flags & MF_MISSILE))
{
if (li->flags & ML_IMPASSIBLE)
return false;
if ((mo->flags & (MF_ENEMY|MF_BOSS)) && li->flags & ML_BLOCKMONSTERS)
return false;
}
// set openrange, opentop, openbottom
P_LineOpening(li, mo);
if (openrange < mo->height)
return false; // doesn't fit
if (opentop - mo->z < mo->height)
return false; // mobj is too high
if (openbottom - mo->z > FixedMul(MAXSTEPMOVE, mo->scale))
return false; // too big a step up
// this line doesn't block movement
return true;
}
//
// PTR_SlideTraverse
//
@ -3435,10 +3396,42 @@ static boolean PTR_SlideTraverse(intercept_t *in)
li = in->d.line;
if (!P_CheckMoveBlocked(li, slidemo))
// one-sided linedefs are always solid to sliding movement.
// one-sided linedef
if (!li->backsector)
{
if (P_PointOnLineSide(slidemo->x, slidemo->y, li))
return true; // don't hit the back side
goto isblocking;
}
if (!(slidemo->flags & MF_MISSILE))
{
if (li->flags & ML_IMPASSIBLE)
goto isblocking;
if ((slidemo->flags & (MF_ENEMY|MF_BOSS)) && li->flags & ML_BLOCKMONSTERS)
goto isblocking;
}
// set openrange, opentop, openbottom
P_LineOpening(li, slidemo);
if (openrange < slidemo->height)
goto isblocking; // doesn't fit
if (opentop - slidemo->z < slidemo->height)
goto isblocking; // mobj is too high
if (openbottom - slidemo->z > FixedMul(MAXSTEPMOVE, slidemo->scale))
goto isblocking; // too big a step up
// this line doesn't block movement
return true;
// the line does block movement,
// see if it is closer than best so far
isblocking:
if (li->polyobj && slidemo->player)
{
if ((li->polyobj->lines[0]->backsector->flags & SF_TRIGGERSPECIAL_TOUCH) && !(li->polyobj->flags & POF_NOSPECIALS))
@ -3516,7 +3509,7 @@ static boolean PTR_SlideTraverse(intercept_t *in)
&& canclimb)
{
slidemo->angle = climbangle;
/*if (!demoplayback || P_AnalogMove(slidemo->player))
/*if (!demoplayback || P_ControlStyle(slidemo->player) == CS_LMAOGALOG)
{
if (slidemo->player == &players[consoleplayer])
localangle = slidemo->angle;
@ -3561,8 +3554,6 @@ static boolean PTR_SlideTraverse(intercept_t *in)
return false; // stop
}
return true; // keep going!
}
//
// P_SlideCameraMove

View file

@ -60,7 +60,7 @@ extern pslope_t *opentopslope, *openbottomslope;
#endif
extern ffloor_t *openfloorrover, *openceilingrover;
void P_LineOpening(line_t *linedef, mobj_t *mobj);
void P_LineOpening(line_t *plinedef, mobj_t *mobj);
boolean P_BlockLinesIterator(INT32 x, INT32 y, boolean(*func)(line_t *));
boolean P_BlockThingsIterator(INT32 x, INT32 y, boolean(*func)(mobj_t *));