mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-26 03:42:37 +01:00
Replaced time(NULL) on sGameTime.GetGameTime() this is used for better performance.
Original Timer.h divided into 2 parts. Shared project has no need to know about GameTime Singleton. 2 Identical structures with different types are now replaced with one generic templated structure and 2 typedefs. --HG-- branch : trunk
This commit is contained in:
@@ -3135,7 +3135,7 @@ 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(std::pair<time_t, ScriptAction>(time_t(sGameTime.GetGameTime() + iter->first), sa));
|
||||
if (iter->first == 0)
|
||||
immedScript = true;
|
||||
|
||||
@@ -3165,7 +3165,7 @@ 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(std::pair<time_t, ScriptAction>(time_t(sGameTime.GetGameTime() + delay), sa));
|
||||
|
||||
sWorld.IncreaseScheduledScriptsCount();
|
||||
|
||||
@@ -3187,7 +3187,7 @@ void Map::ScriptsProcess()
|
||||
///- Process overdue queued scripts
|
||||
std::multimap<time_t, ScriptAction>::iterator iter = m_scriptSchedule.begin();
|
||||
// ok as multimap is a *sorted* associative container
|
||||
while (!m_scriptSchedule.empty() && (iter->first <= sWorld.GetGameTime()))
|
||||
while (!m_scriptSchedule.empty() && (iter->first <= sGameTime.GetGameTime()))
|
||||
{
|
||||
ScriptAction const& step = iter->second;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user