From 7dddc631d798469725e40bd3fbc1a2617f4982ee Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 31 Jul 2021 21:14:48 +0100 Subject: [PATCH] P_ZMovement: add a P_MobjWasRemoved check after P_CheckPosition, so we can bail out if the mobj was removed (by Lua most likely) --- src/p_mobj.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index 10220fff6..3bb7ac58d 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -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;