Core/Game: Move scheduled map scripts counter methods into MapManager

* Since those have nothing to do with core scripts and are
  not wished inside the ScriptMgr
This commit is contained in:
Naios
2016-04-11 20:07:24 +02:00
parent 26dcde94b3
commit 59e3cf82ac
8 changed files with 21 additions and 22 deletions
+4 -3
View File
@@ -20,6 +20,7 @@
#include "GridNotifiers.h"
#include "GossipDef.h"
#include "Map.h"
#include "MapManager.h"
#include "ObjectMgr.h"
#include "Pet.h"
#include "Item.h"
@@ -57,7 +58,7 @@ void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, O
if (iter->first == 0)
immedScript = true;
sScriptMgr->IncreaseScheduledScriptsCount();
sMapMgr->IncreaseScheduledScriptsCount();
}
///- If one of the effects should be immediate, launch the script execution
if (/*start &&*/ immedScript && !i_scriptLock)
@@ -85,7 +86,7 @@ void Map::ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* sou
sa.script = &script;
m_scriptSchedule.insert(ScriptScheduleMap::value_type(time_t(sWorld->GetGameTime() + delay), sa));
sScriptMgr->IncreaseScheduledScriptsCount();
sMapMgr->IncreaseScheduledScriptsCount();
///- If effects should be immediate, launch the script execution
if (delay == 0 && !i_scriptLock)
@@ -902,6 +903,6 @@ void Map::ScriptsProcess()
m_scriptSchedule.erase(iter);
iter = m_scriptSchedule.begin();
sScriptMgr->DecreaseScheduledScriptCount();
sMapMgr->DecreaseScheduledScriptCount();
}
}