- added a new thinker statnum STAT_STATIC which do not get deleted between levels.

This commit is contained in:
Christoph Oelckers 2017-02-25 16:56:49 +01:00
parent 10c6b7a80b
commit d39ee1daf3
6 changed files with 6 additions and 2 deletions

View file

@ -2708,6 +2708,7 @@ void D_DoomMain (void)
// clean up game state
ST_Clear();
D_ErrorCleanup ();
DThinker::DestroyThinkersInList(STAT_STATIC);
P_FreeLevelData();
P_FreeExtraLevelData();

View file

@ -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]);

View file

@ -427,6 +427,7 @@ void G_InitNew (const char *mapname, bool bTitleLevel)
UnlatchCVars ();
G_VerifySkill();
UnlatchCVars ();
DThinker::DestroyThinkersInList(STAT_STATIC);
if (paused)
{

View file

@ -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()<chance))
if ((flags & SMF_LOOK) && (self->tracer == nullptr) && (pr_seekermissile()<chance))
{
self->tracer = P_RoughMonsterSearch (self, distance, true);
}

View file

@ -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 ();

View file

@ -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,