addressed amb1201 - no_mapchange timers now get removed right after onmapend

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401727
This commit is contained in:
David Anderson 2007-11-25 02:45:12 +00:00
parent ef8db35a49
commit 54ad852d72
4 changed files with 13 additions and 19 deletions

View File

@ -29,7 +29,7 @@
* Version: $Id$
*/
#if defined CRAZY_DEBUG
#if defined DEBUG
#include "sm_globals.h"
#include "sourcemm_api.h"
#include "Tlhelp32.h"

View File

@ -224,11 +224,6 @@ void TimerSystem::OnSourceModShutdown()
g_Forwards.ReleaseForward(m_pOnMapTimeLeftChanged);
}
void TimerSystem::OnSourceModLevelChange(const char *mapName)
{
MapChange(true);
}
void TimerSystem::OnSourceModLevelEnd()
{
m_bHasMapTickedYet = false;
@ -423,7 +418,7 @@ void TimerSystem::KillTimer(ITimer *pTimer)
}
CStack<ITimer *> s_tokill;
void TimerSystem::MapChange(bool real_mapchange)
void TimerSystem::RemoveMapChangeTimers()
{
ITimer *pTimer;
TimerIter iter;
@ -431,7 +426,7 @@ void TimerSystem::MapChange(bool real_mapchange)
for (iter=m_SingleTimers.begin(); iter!=m_SingleTimers.end(); iter++)
{
pTimer = (*iter);
if (real_mapchange && (pTimer->m_Flags & TIMER_FLAG_NO_MAPCHANGE))
if (pTimer->m_Flags & TIMER_FLAG_NO_MAPCHANGE)
{
s_tokill.push(pTimer);
}
@ -440,7 +435,7 @@ void TimerSystem::MapChange(bool real_mapchange)
for (iter=m_LoopTimers.begin(); iter!=m_LoopTimers.end(); iter++)
{
pTimer = (*iter);
if (real_mapchange && (pTimer->m_Flags & TIMER_FLAG_NO_MAPCHANGE))
if (pTimer->m_Flags & TIMER_FLAG_NO_MAPCHANGE)
{
s_tokill.push(pTimer);
}

View File

@ -66,7 +66,6 @@ public:
~TimerSystem();
public: //SMGlobalClass
void OnSourceModAllInitialized();
void OnSourceModLevelChange(const char *mapName);
void OnSourceModLevelEnd();
void OnSourceModGameInitialized();
void OnSourceModShutdown();
@ -81,7 +80,7 @@ public: //ITimerSystem
bool GetMapTimeLeft(float *pTime);
public:
void RunFrame();
void MapChange(bool real_mapchange);
void RemoveMapChangeTimers();
void GameFrame(bool simulating);
IMapTimer *GetMapTimer();
private:

View File

@ -85,7 +85,6 @@ SourceModBase::SourceModBase()
{
m_IsMapLoading = false;
m_ExecPluginReload = false;
m_ExecOnMapEnd = false;
m_GotBasePath = false;
}
@ -326,7 +325,6 @@ bool SourceModBase::LevelInit(char const *pMapName, char const *pMapEntities, ch
m_IsMapLoading = true;
m_ExecPluginReload = true;
m_ExecOnMapEnd = true;
/* Notify! */
SMGlobalClass *pBase = SMGlobalClass::head;
@ -368,13 +366,15 @@ void SourceModBase::LevelShutdown()
next->OnSourceModLevelEnd();
next = next->m_pGlobalClassNext;
}
g_LevelEndBarrier = false;
}
if (g_pOnMapEnd && m_ExecOnMapEnd)
{
g_pOnMapEnd->Execute(NULL);
m_ExecOnMapEnd = false;
if (g_pOnMapEnd != NULL)
{
g_pOnMapEnd->Execute(NULL);
}
g_Timers.RemoveMapChangeTimers();
g_LevelEndBarrier = false;
}
g_OnMapStarted = false;