addressed amb1201 - no_mapchange timers now get removed right after onmapend
authorDavid Anderson <dvander@alliedmods.net>
Sun Nov 25 02:45:12 2007 +0000 (2007-11-25)
changeset 1721d54c379f7171
parent 1720 6a9ff57fb9f9
child 1722 2c16f160f5dd
addressed amb1201 - no_mapchange timers now get removed right after onmapend
core/CrazyDebugger.cpp
core/TimerSys.cpp
core/TimerSys.h
core/sourcemod.cpp
     1.1 --- a/core/CrazyDebugger.cpp	Sat Nov 24 18:17:00 2007 +0000
     1.2 +++ b/core/CrazyDebugger.cpp	Sun Nov 25 02:45:12 2007 +0000
     1.3 @@ -29,7 +29,7 @@
     1.4   * Version: $Id$
     1.5   */
     1.6  
     1.7 -#if defined CRAZY_DEBUG
     1.8 +#if defined DEBUG
     1.9  #include "sm_globals.h"
    1.10  #include "sourcemm_api.h"
    1.11  #include "Tlhelp32.h"
     2.1 --- a/core/TimerSys.cpp	Sat Nov 24 18:17:00 2007 +0000
     2.2 +++ b/core/TimerSys.cpp	Sun Nov 25 02:45:12 2007 +0000
     2.3 @@ -224,11 +224,6 @@
     2.4  	g_Forwards.ReleaseForward(m_pOnMapTimeLeftChanged);
     2.5  }
     2.6  
     2.7 -void TimerSystem::OnSourceModLevelChange(const char *mapName)
     2.8 -{
     2.9 -	MapChange(true);
    2.10 -}
    2.11 -
    2.12  void TimerSystem::OnSourceModLevelEnd()
    2.13  {
    2.14  	m_bHasMapTickedYet = false;
    2.15 @@ -423,7 +418,7 @@
    2.16  }
    2.17  
    2.18  CStack<ITimer *> s_tokill;
    2.19 -void TimerSystem::MapChange(bool real_mapchange)
    2.20 +void TimerSystem::RemoveMapChangeTimers()
    2.21  {
    2.22  	ITimer *pTimer;
    2.23  	TimerIter iter;
    2.24 @@ -431,7 +426,7 @@
    2.25  	for (iter=m_SingleTimers.begin(); iter!=m_SingleTimers.end(); iter++)
    2.26  	{
    2.27  		pTimer = (*iter);
    2.28 -		if (real_mapchange && (pTimer->m_Flags & TIMER_FLAG_NO_MAPCHANGE))
    2.29 +		if (pTimer->m_Flags & TIMER_FLAG_NO_MAPCHANGE)
    2.30  		{
    2.31  			s_tokill.push(pTimer);
    2.32  		}
    2.33 @@ -440,7 +435,7 @@
    2.34  	for (iter=m_LoopTimers.begin(); iter!=m_LoopTimers.end(); iter++)
    2.35  	{
    2.36  		pTimer = (*iter);
    2.37 -		if (real_mapchange && (pTimer->m_Flags & TIMER_FLAG_NO_MAPCHANGE))
    2.38 +		if (pTimer->m_Flags & TIMER_FLAG_NO_MAPCHANGE)
    2.39  		{
    2.40  			s_tokill.push(pTimer);
    2.41  		}
     3.1 --- a/core/TimerSys.h	Sat Nov 24 18:17:00 2007 +0000
     3.2 +++ b/core/TimerSys.h	Sun Nov 25 02:45:12 2007 +0000
     3.3 @@ -66,7 +66,6 @@
     3.4  	~TimerSystem();
     3.5  public: //SMGlobalClass
     3.6  	void OnSourceModAllInitialized();
     3.7 -	void OnSourceModLevelChange(const char *mapName);
     3.8  	void OnSourceModLevelEnd();
     3.9  	void OnSourceModGameInitialized();
    3.10  	void OnSourceModShutdown();
    3.11 @@ -81,7 +80,7 @@
    3.12  	bool GetMapTimeLeft(float *pTime);
    3.13  public:
    3.14  	void RunFrame();
    3.15 -	void MapChange(bool real_mapchange);
    3.16 +	void RemoveMapChangeTimers();
    3.17  	void GameFrame(bool simulating);
    3.18  	IMapTimer *GetMapTimer();
    3.19  private:
     4.1 --- a/core/sourcemod.cpp	Sat Nov 24 18:17:00 2007 +0000
     4.2 +++ b/core/sourcemod.cpp	Sun Nov 25 02:45:12 2007 +0000
     4.3 @@ -85,7 +85,6 @@
     4.4  {
     4.5  	m_IsMapLoading = false;
     4.6  	m_ExecPluginReload = false;
     4.7 -	m_ExecOnMapEnd = false;
     4.8  	m_GotBasePath = false;
     4.9  }
    4.10  
    4.11 @@ -326,7 +325,6 @@
    4.12  
    4.13  	m_IsMapLoading = true;
    4.14  	m_ExecPluginReload = true;
    4.15 -	m_ExecOnMapEnd = true;
    4.16  
    4.17  	/* Notify! */
    4.18  	SMGlobalClass *pBase = SMGlobalClass::head;
    4.19 @@ -368,13 +366,15 @@
    4.20  			next->OnSourceModLevelEnd();
    4.21  			next = next->m_pGlobalClassNext;
    4.22  		}
    4.23 -		g_LevelEndBarrier = false;
    4.24 -	}
    4.25 +		
    4.26 +		if (g_pOnMapEnd != NULL)
    4.27 +		{
    4.28 +			g_pOnMapEnd->Execute(NULL);
    4.29 +		}
    4.30  
    4.31 -	if (g_pOnMapEnd && m_ExecOnMapEnd)
    4.32 -	{
    4.33 -		g_pOnMapEnd->Execute(NULL);
    4.34 -		m_ExecOnMapEnd = false;
    4.35 +		g_Timers.RemoveMapChangeTimers();
    4.36 +
    4.37 +		g_LevelEndBarrier = false;
    4.38  	}
    4.39  
    4.40  	g_OnMapStarted = false;