Fix resync crash

This commit is contained in:
NepDisk 2025-09-12 12:39:48 -04:00
parent b87868d07e
commit a02fbacf01

View file

@ -11733,9 +11733,9 @@ void P_FreePrecipMobj(precipmobj_t *mobj)
// Clearing out stuff for savegames
void P_RemoveSavegameMobj(mobj_t *mobj)
{
// unlink from sector and block lists
if (((thinker_t *)mobj)->function.acp1 == (actionf_p1)P_NullPrecipThinker)
{
// unlink from sector and block lists
P_UnsetPrecipThingPosition((precipmobj_t *)mobj);
if (precipsector_list)
@ -11758,20 +11758,18 @@ void P_RemoveSavegameMobj(mobj_t *mobj)
P_DelSeclist(sector_list);
sector_list = NULL;
}
P_DeleteMobjStringArgs(mobj);
}
// stop any playing sound
S_StopSound(mobj);
R_RemoveMobjInterpolator(mobj);
P_DeleteMobjStringArgs(mobj);
R_RemoveMobjInterpolator(mobj);
// free block
// Here we use the same code as R_RemoveThinkerDelayed, but without reference counting (we're removing everything so it shouldn't matter) and without touching currentthinker since we aren't in P_RunThinkers
{
thinker_t *thinker = (thinker_t *)mobj;
thinker_t *next = thinker->next;
(next->prev = thinker->prev)->next = next;
Z_Free(thinker);
}
P_UnlinkThinker((thinker_t*)mobj);
}
static CV_PossibleValue_t respawnitemtime_cons_t[] = {{1, "MIN"}, {300, "MAX"}, {0, NULL}};