Merge branch 'fix-spawnpoint-dangling-mobj' into 'next'

Fix dangling pointer in mapthing after removing mobj

See merge request STJr/SRB2!2007
This commit is contained in:
sphere 2023-11-29 11:22:55 +00:00
commit f32dfb4bc3

View file

@ -11206,6 +11206,10 @@ void P_RemoveMobj(mobj_t *mobj)
P_SetTarget(&mobj->hnext, P_SetTarget(&mobj->hprev, NULL));
// clear the reference from the mapthing
if (mobj->spawnpoint)
mobj->spawnpoint->mobj = NULL;
R_RemoveMobjInterpolator(mobj);
// free block