P_ZMovement: add a P_MobjWasRemoved check after P_CheckPosition, so we can bail out if the mobj was removed (by Lua most likely)

This commit is contained in:
Monster Iestyn 2021-07-31 21:14:48 +01:00
parent 113cedd4b6
commit 7dddc631d7

View file

@ -2549,6 +2549,10 @@ boolean P_ZMovement(mobj_t *mo)
}
P_CheckPosition(mo, mo->x, mo->y); // Sets mo->standingslope correctly
if (P_MobjWasRemoved(mobj)) // mobjs can be removed by P_CheckPosition -- Monster Iestyn 31/07/21
return false;
if (((mo->eflags & MFE_VERTICALFLIP) ? tmceilingslope : tmfloorslope) && (mo->type != MT_STEAM))
{
mo->standingslope = (mo->eflags & MFE_VERTICALFLIP) ? tmceilingslope : tmfloorslope;