diff --git a/src/d_main.cpp b/src/d_main.cpp index c7a001dfe..02cbca73a 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -2708,6 +2708,7 @@ void D_DoomMain (void) // clean up game state ST_Clear(); D_ErrorCleanup (); + DThinker::DestroyThinkersInList(STAT_STATIC); P_FreeLevelData(); P_FreeExtraLevelData(); diff --git a/src/dthinker.cpp b/src/dthinker.cpp index da68d8388..fddc28317 100644 --- a/src/dthinker.cpp +++ b/src/dthinker.cpp @@ -422,7 +422,7 @@ void DThinker::DestroyAllThinkers () for (i = 0; i <= MAX_STATNUM; i++) { - if (i != STAT_TRAVELLING) + if (i != STAT_TRAVELLING && i != STAT_STATIC) { DestroyThinkersInList (Thinkers[i]); DestroyThinkersInList (FreshThinkers[i]); diff --git a/src/g_level.cpp b/src/g_level.cpp index b811c1215..01911f742 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -427,6 +427,7 @@ void G_InitNew (const char *mapname, bool bTitleLevel) UnlatchCVars (); G_VerifySkill(); UnlatchCVars (); + DThinker::DestroyThinkersInList(STAT_STATIC); if (paused) { diff --git a/src/p_actionfunctions.cpp b/src/p_actionfunctions.cpp index 8f916614b..16c8c3267 100644 --- a/src/p_actionfunctions.cpp +++ b/src/p_actionfunctions.cpp @@ -1124,7 +1124,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SeekerMissile) PARAM_INT_DEF(chance); PARAM_INT_DEF(distance); - if ((flags & SMF_LOOK) && (self->tracer == 0) && (pr_seekermissile()tracer == nullptr) && (pr_seekermissile()tracer = P_RoughMonsterSearch (self, distance, true); } diff --git a/src/p_setup.cpp b/src/p_setup.cpp index ac7faea76..308054a8b 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -4202,6 +4202,7 @@ void P_Init () static void P_Shutdown () { // [ZZ] delete global event handlers + DThinker::DestroyThinkersInList(STAT_STATIC); E_Shutdown(false); P_DeinitKeyMessages (); P_FreeLevelData (); diff --git a/src/statnums.h b/src/statnums.h index 7f691e232..dd868bbe1 100644 --- a/src/statnums.h +++ b/src/statnums.h @@ -45,6 +45,7 @@ enum STAT_AUTODECAL, // A decal that can be automatically deleted STAT_CORPSEPOINTER, // An entry in Hexen's corpse queue STAT_TRAVELLING, // An actor temporarily travelling to a new map + STAT_STATIC, // persistent across maps. // Thinkers that do think STAT_FIRST_THINKING=32,