From 066adb972e585e8e21bc85875edff37a7a3bb920 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 21 Jun 2026 23:05:53 +0200 Subject: [PATCH] add some more mobj null checks to P_MobjThinker from srb2 ig --- src/p_mobj.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index 96a8e11d5..5e33a9803 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9167,6 +9167,11 @@ void P_MobjThinker(mobj_t *mobj) || P_WeaponOrPanel(mobj->type)) { P_TryMove(mobj, mobj->x, mobj->y, true); // Sets mo->standingslope correctly + + //if (P_MobjWasRemoved(mobj)) + if (!mobj) // anything that calls checkposition can be lethal + return; + P_ButteredSlope(mobj); } @@ -9192,6 +9197,10 @@ void P_MobjThinker(mobj_t *mobj) } } + //if (P_MobjWasRemoved(mobj)) + if (!mobj) + return; // obligatory paranoia check + // Can end up here if a player dies. P_CycleMobjState(mobj);