Fix dangling pointer in mapthing after removing mobj

This commit is contained in:
Gustaf Alhäll 2023-06-02 23:44:50 +02:00
parent a68440c4db
commit e264caffe3
No known key found for this signature in database
GPG key ID: 6C1F67D690CDEDFD

View file

@ -11204,6 +11204,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