From 55405600ea70ba8e3d621014375bb459ede8b2e6 Mon Sep 17 00:00:00 2001 From: NepDisk Date: Thu, 27 Feb 2025 12:24:14 -0500 Subject: [PATCH] Fix rare Bubble Shield crash https://git.do.srb2.org/KartKrew/RingRacers/-/commit/30d7e94ecefdf2f061909869f7b3a090d3cbd594 --- src/p_map.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 49e340f49..dfca923b0 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -687,7 +687,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) return BMIT_CONTINUE; // Bubble Shield reflect - if (((thing->type == MT_BUBBLESHIELD && thing->target->player && thing->target->player->bubbleblowup) + if (((thing->type == MT_BUBBLESHIELD && !P_MobjWasRemoved(thing->target) && thing->target->player && thing->target->player->bubbleblowup) || (thing->player && thing->player->bubbleblowup)) && (g_tm.thing->type == MT_ORBINAUT || g_tm.thing->type == MT_JAWZ || g_tm.thing->type == MT_JAWZ_DUD || g_tm.thing->type == MT_BANANA || g_tm.thing->type == MT_EGGMANITEM || g_tm.thing->type == MT_BALLHOG @@ -702,7 +702,7 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) return K_BubbleShieldCollide(thing, g_tm.thing) ? BMIT_CONTINUE : BMIT_ABORT; } - else if (((g_tm.thing->type == MT_BUBBLESHIELD && g_tm.thing->target->player && g_tm.thing->target->player->bubbleblowup) + else if (((g_tm.thing->type == MT_BUBBLESHIELD && !P_MobjWasRemoved(g_tm.thing->target) && g_tm.thing->target->player && g_tm.thing->target->player->bubbleblowup) || (g_tm.thing->player && g_tm.thing->player->bubbleblowup)) && (thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD || thing->type == MT_BANANA || thing->type == MT_EGGMANITEM || thing->type == MT_BALLHOG