prevent potential crash when trying to kill bananachain

This commit is contained in:
Alug committed 2024-07-03 13:02:53 +02:00
1 parent 91d052d25e
commit a28a590078
1 file changed
+1 -1
+1 -1
View File
@@ -1955,7 +1955,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
{
if (target->movedir != 0 && target->movedir < (UINT16)target->target->player->kartstuff[k_itemamount])
{
if (target->target->hnext)
if (target->target->hnext && !P_MobjWasRemoved(target->target->hnext))
K_KillBananaChain(target->target->hnext, inflictor, source);
target->target->player->kartstuff[k_itemamount] = 0;
}