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:
n0n4m3
2009-12-23 08:04:10 +01:00
parent 7ea2510980
commit 3fe0bc5254
51 changed files with 352 additions and 364 deletions

View File

@@ -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;