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

(cherry picked from commit 59e3cf82ac)
This commit is contained in:
Naios
2016-04-02 22:37:51 +02:00
parent 518692b4cb
commit 775e0764e8
8 changed files with 20 additions and 21 deletions

View File

@@ -21,6 +21,7 @@
#include "GridNotifiersImpl.h"
#include "GossipDef.h"
#include "Map.h"
#include "MapManager.h"
#include "ObjectMgr.h"
#include "Pet.h"
#include "Item.h"
@@ -58,7 +59,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)
@@ -86,7 +87,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)
@@ -878,6 +879,6 @@ void Map::ScriptsProcess()
m_scriptSchedule.erase(iter);
iter = m_scriptSchedule.begin();
sScriptMgr->DecreaseScheduledScriptCount();
sMapMgr->DecreaseScheduledScriptCount();
}
}