Fix stale reference in P_KillMobj (crash)

This commit is contained in:
AJ Martinez 2024-02-07 15:09:26 -07:00 committed by NepDisk
parent 97b9e7d4fc
commit 5a4cd36e23

View file

@ -1099,7 +1099,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
// SRB2kart
// I wish I knew a better way to do this
if (target->target && target->target->player && target->target->player->mo)
if (!P_MobjWasRemoved(target->target) && target->target->player && !P_MobjWasRemoved(target->target->player->mo))
{
if ((target->target->player->pflags & PF_EGGMANOUT) && target->type == MT_EGGMANITEM_SHIELD)
target->target->player->pflags &= ~PF_EGGMANOUT;