diff options
author | zergtmn <zerg@myisp.com> | 2011-04-13 12:07:20 +0600 |
---|---|---|
committer | Azazel <azazel.kon@gmail.com> | 2011-04-13 12:07:20 +0600 |
commit | 1551b8a01186874df8076e500e3d5ee8f5cf127b (patch) | |
tree | 004af12a19317693031afbb220ee9c8cfac5d434 /src/server/game/Scripting/MapScripts.cpp | |
parent | e196dd80bdc919300ad0995728b03e70d76de6a2 (diff) |
Core/Misc: move scheduled scripts counter to ScriptMgr (which is more logical, isn't it?)
Diffstat (limited to 'src/server/game/Scripting/MapScripts.cpp')
-rwxr-xr-x | src/server/game/Scripting/MapScripts.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
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, ScriptAction>(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, ScriptAction>(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<time_t, ScriptAction>::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(); } } |