From 1551b8a01186874df8076e500e3d5ee8f5cf127b Mon Sep 17 00:00:00 2001 From: zergtmn Date: Wed, 13 Apr 2011 12:07:20 +0600 Subject: Core/Misc: move scheduled scripts counter to ScriptMgr (which is more logical, isn't it?) --- src/server/game/Scripting/MapScripts.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/server/game/Scripting/MapScripts.cpp') diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index 7460acf43ef..7a54ec5df21 100755 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -28,6 +28,7 @@ #include "MapManager.h" #include "ObjectMgr.h" #include "MapRefManager.h" +#include "ScriptMgr.h" /// Put scripts in the execution queue void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, Object* target) @@ -53,11 +54,11 @@ void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, O sa.ownerGUID = ownerGUID; sa.script = &iter->second; - m_scriptSchedule.insert(std::pair(time_t(sWorld->GetGameTime() + iter->first), sa)); + m_scriptSchedule.insert(ScriptScheduleMap::value_type(time_t(sWorld->GetGameTime() + iter->first), sa)); if (iter->first == 0) immedScript = true; - sWorld->IncreaseScheduledScriptsCount(); + sScriptMgr->IncreaseScheduledScriptsCount(); } ///- If one of the effects should be immediate, launch the script execution if (/*start &&*/ immedScript && !i_scriptLock) @@ -83,9 +84,9 @@ void Map::ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* sou sa.ownerGUID = ownerGUID; sa.script = &script; - m_scriptSchedule.insert(std::pair(time_t(sWorld->GetGameTime() + delay), sa)); + m_scriptSchedule.insert(ScriptScheduleMap::value_type(time_t(sWorld->GetGameTime() + delay), sa)); - sWorld->IncreaseScheduledScriptsCount(); + sScriptMgr->IncreaseScheduledScriptsCount(); ///- If effects should be immediate, launch the script execution if (delay == 0 && !i_scriptLock) @@ -289,7 +290,7 @@ void Map::ScriptsProcess() return; ///- Process overdue queued scripts - std::multimap::iterator iter = m_scriptSchedule.begin(); + ScriptScheduleMap::iterator iter = m_scriptSchedule.begin(); // ok as multimap is a *sorted* associative container while (!m_scriptSchedule.empty() && (iter->first <= sWorld->GetGameTime())) { @@ -923,8 +924,7 @@ void Map::ScriptsProcess() } m_scriptSchedule.erase(iter); - sWorld->DecreaseScheduledScriptCount(); - iter = m_scriptSchedule.begin(); + sScriptMgr->DecreaseScheduledScriptCount(); } } -- cgit v1.2.3