mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 17:27:36 +01:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user