Fix PlayerZMovement spam and infinite MFE_JUSTHITFLOOR when standing on a solid object

This commit is contained in:
katsy 2024-04-08 00:07:51 -05:00
parent b6544efceb
commit b2ff4e6167

View file

@ -2245,7 +2245,7 @@ boolean P_ZMovement(mobj_t *mo)
else if (!onground)
P_SlopeLaunch(mo);
}
if (!mo->player && P_CheckDeathPitCollide(mo) && mo->health
&& !(mo->flags & MF_NOCLIPHEIGHT) && !(mo->flags2 & MF2_BOSSDEAD))
{
@ -2938,7 +2938,7 @@ boolean P_SceneryZMovement(mobj_t *mo)
mo->eflags &= ~MFE_APPLYPMOMZ;
}
mo->z += mo->momz;
if (!mo->player && P_CheckDeathPitCollide(mo) && mo->health
&& !(mo->flags & MF_NOCLIPHEIGHT) && !(mo->flags2 & MF2_BOSSDEAD))
{
@ -3781,7 +3781,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
// always do the gravity bit now, that's simpler
// BUT CheckPosition only if wasn't done before.
if (!(mobj->eflags & MFE_ONGROUND) || mobj->momz
if (mobj->momz
|| ((mobj->eflags & MFE_VERTICALFLIP) && mobj->z + mobj->height != mobj->ceilingz)
|| (!(mobj->eflags & MFE_VERTICALFLIP) && mobj->z != mobj->floorz)
|| P_IsObjectInGoop(mobj))
@ -3794,17 +3794,6 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
}
else
{
#if 0 // i don't know why this is here, it's causing a few undesired state glitches, and disabling it doesn't appear to negatively affect the game, but i don't want it gone permanently just in case some obscure bug crops up
if (!(mobj->player->powers[pw_carry] == CR_NIGHTSMODE)) // used for drilling
mobj->player->pflags &= ~PF_STARTJUMP;
mobj->player->pflags &= ~(PF_JUMPED|PF_NOJUMPDAMAGE);
if (mobj->player->secondjump || mobj->player->powers[pw_tailsfly])
{
mobj->player->secondjump = 0;
mobj->player->powers[pw_tailsfly] = 0;
P_SetMobjState(mobj, S_PLAY_WALK);
}
#endif
mobj->eflags &= ~MFE_JUSTHITFLOOR;
}
@ -10730,7 +10719,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type, ...)
// Set shadowscale here, before spawn hook so that Lua can change it
mobj->shadowscale = P_DefaultMobjShadowScale(mobj);
// A monitor can't respawn if we're not in multiplayer,
// or if we're in co-op and it's score or a 1up
if (mobj->flags & MF_MONITOR && (!(netgame || multiplayer)