From 6d983852d9df4be65435bbe733a9d14712a9565c Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Wed, 8 Mar 2023 15:58:56 -0700 Subject: [PATCH] Fix null ref in eggman transfer --- src/p_map.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index a02a5191d..07241dccb 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1412,12 +1412,15 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) K_PvPTouchDamage(tm.thing, thing); } - if (thing->player->eggmanexplode) + if (!P_MobjWasRemoved(thing) && !P_MobjWasRemoved(tm.thing)) { - K_EggmanTransfer(thing->player, tm.thing->player); - } else if (tm.thing->player->eggmanexplode) - { - K_EggmanTransfer(tm.thing->player, thing->player); + if (thing->player->eggmanexplode) + { + K_EggmanTransfer(thing->player, tm.thing->player); + } else if (tm.thing->player->eggmanexplode) + { + K_EggmanTransfer(tm.thing->player, thing->player); + } } return BMIT_CONTINUE;