mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[11259] Move scheduled scripts counter to ScriptMgr
Also cleanup forward declarations.
This commit is contained in:
parent
dee6d712c4
commit
a6d155fc54
9 changed files with 33 additions and 33 deletions
|
|
@ -43,7 +43,7 @@ Map::~Map()
|
|||
UnloadAll(true);
|
||||
|
||||
if(!m_scriptSchedule.empty())
|
||||
sWorld.DecreaseScheduledScriptCount(m_scriptSchedule.size());
|
||||
sScriptMgr.DecreaseScheduledScriptCount(m_scriptSchedule.size());
|
||||
|
||||
if (m_persistentState)
|
||||
m_persistentState->SetUsedByMapState(NULL); // field pointer can be deleted after this
|
||||
|
|
@ -1675,11 +1675,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 (immedScript)
|
||||
|
|
@ -1701,9 +1701,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)
|
||||
|
|
@ -1717,7 +1717,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()))
|
||||
{
|
||||
|
|
@ -2823,9 +2823,9 @@ void Map::ScriptsProcess()
|
|||
}
|
||||
|
||||
m_scriptSchedule.erase(iter);
|
||||
sWorld.DecreaseScheduledScriptCount();
|
||||
|
||||
iter = m_scriptSchedule.begin();
|
||||
|
||||
sScriptMgr.DecreaseScheduledScriptCount();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue