Fix segfault when killing wall spike while it moves

This commit is contained in:
Gustaf Alhäll 2023-04-10 14:55:19 +02:00
parent 3c81938496
commit 8b77af7378
No known key found for this signature in database
GPG key ID: 6C1F67D690CDEDFD

View file

@ -10061,6 +10061,8 @@ static boolean P_FuseThink(mobj_t *mobj)
case MT_SPIKE:
case MT_WALLSPIKE:
P_SetMobjState(mobj, mobj->state->nextstate);
if (P_MobjWasRemoved(mobj))
return false;
mobj->fuse = mobj->spawnpoint ? mobj->spawnpoint->args[0] : mobj->info->speed;
break;
case MT_NIGHTSCORE:
@ -10222,6 +10224,9 @@ void P_MobjThinker(mobj_t *mobj)
if (mobj->flags2 & MF2_FIRING)
P_FiringThink(mobj);
if (P_MobjWasRemoved(mobj))
return;
if (mobj->type == MT_AMBIENT)
{
if (leveltime % mobj->health)