Revert P_InitThinkers: Centralise/tidy global mobj pointer handling

This reverts commit 19da924b5e.
This commit is contained in:
NepDisk 2024-10-21 15:54:09 -04:00
parent 9071539154
commit 509fda70d5
3 changed files with 17 additions and 14 deletions

View file

@ -4311,8 +4311,16 @@ static void P_NetUnArchiveThinkers(savebuffer_t *save)
}
// we don't want the removed mobjs to come back
iquetail = iquehead = 0;
P_InitThinkers();
// Oh my god don't blast random memory with our reference counts.
boss3cap = waypointcap = kitemcap = NULL;
for (i = 0; i <= 15; i++)
{
skyboxcenterpnts[i] = skyboxviewpnts[i] = NULL;
}
// clear sector thinker pointers so they don't point to non-existant thinkers for all of eternity
for (i = 0; i < numsectors; i++)
{

View file

@ -8427,6 +8427,9 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
memset(localaiming, 0, sizeof(localaiming));
K_InitDirector();
}
// clear special respawning que
iquehead = iquetail = 0;
// Remove the loading shit from the screen
if (rendermode != render_none && !titlemapinaction && !reloadinggamestate)

View file

@ -204,24 +204,16 @@ void Command_CountMobjs_f(void)
void P_InitThinkers(void)
{
UINT8 i;
for (i = 0; i < NUM_THINKERLISTS; i++)
{
thlist[i].prev = thlist[i].next = &thlist[i];
}
iquehead = iquetail = 0;
boss3cap = NULL;
waypointcap = NULL;
kitemcap = NULL;
for (i = 0; i <= 15; i++)
{
skyboxcenterpnts[i] = skyboxviewpnts[i] = NULL;
}
P_InvalidateThinkersWithoutInit();
for (i = 0; i < NUM_THINKERLISTS; i++)
thlist[i].prev = thlist[i].next = &thlist[i];
iquehead = iquetail = 0;
}
//
// P_InvalidateThinkersWithoutInit
//