From 69c3aaf4f2fc186586e8f3f1ebed246b10a72d6c Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 12 Jan 2024 02:05:45 -0800 Subject: [PATCH] Gachabom Rebound: fix crash after owner object is removed --- src/info.c | 2 +- src/objects/orbinaut.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/info.c b/src/info.c index 4ed3520e2..9e57f5690 100644 --- a/src/info.c +++ b/src/info.c @@ -5601,7 +5601,7 @@ state_t states[NUMSTATES] = {SPR_UFOS, 0, -1, {NULL}, 0, 0, S_NULL}, // S_SPECIAL_UFO_STEM {SPR_GBOM, FF_ANIMATE, -1, {NULL}, 3, 1, S_NULL}, // S_GACHABOM - {SPR_GBOM, FF_INVERT, 2, {NULL}, 0, 0, S_NULL}, // S_GACHABOM_DEAD + {SPR_GBOM, FF_INVERT, 175, {NULL}, 0, 0, S_NULL}, // S_GACHABOM_DEAD {SPR_NULL, 0, 1, {NULL}, 0, 0, S_GACHABOM_EXPLOSION_2}, {SPR_GCHX, 0|FF_PAPERSPRITE|FF_ANIMATE, 14, {NULL}, 6, 2, S_GACHABOM_EXPLOSION_3A}, // S_GACHABOM_EXPLOSION_2 diff --git a/src/objects/orbinaut.c b/src/objects/orbinaut.c index 631b6f79e..a158b9a93 100644 --- a/src/objects/orbinaut.c +++ b/src/objects/orbinaut.c @@ -284,12 +284,13 @@ boolean Obj_OrbinautJawzCollide(mobj_t *t1, mobj_t *t2) S_StartSound(t1, t1->info->deathsound); P_KillMobj(t1, t2, t2, DMG_NORMAL); - if (t1->type == MT_GACHABOM) + if (t1->type == MT_GACHABOM && !P_MobjWasRemoved(orbinaut_owner(t1))) { // Instead of flying out at an angle when // destroyed, spawn an explosion and eventually // return to sender. The original Gachabom will be // removed next tic (see deathstate). + t1->tics = 2; Obj_SpawnGachaBomRebound(t1, orbinaut_owner(t1)); } else