Ensure that all actions are compared to fixed point in time (ie. world update start)

Port From (https://github.com/TrinityCore/TrinityCore/commit/60663d1374beef3103f4787152654034fa4a8897)
This commit is contained in:
hondacrx
2019-09-01 10:37:14 -04:00
parent dccded6a96
commit 87d30caa49
38 changed files with 302 additions and 169 deletions
+3 -3
View File
@@ -3446,7 +3446,7 @@ namespace Game.Maps
sa.ownerGUID = ownerGUID;
sa.script = script.Value;
m_scriptSchedule.Add(Global.WorldMgr.GetGameTime() + script.Key, sa);
m_scriptSchedule.Add(GameTime.GetGameTime() + script.Key, sa);
if (script.Key == 0)
immedScript = true;
@@ -3476,7 +3476,7 @@ namespace Game.Maps
sa.ownerGUID = ownerGUID;
sa.script = script;
m_scriptSchedule.Add(Global.WorldMgr.GetGameTime() + delay, sa);
m_scriptSchedule.Add(GameTime.GetGameTime() + delay, sa);
Global.MapMgr.IncreaseScheduledScriptsCount();
@@ -3674,7 +3674,7 @@ namespace Game.Maps
// Process overdue queued scripts
KeyValuePair<long, ScriptAction> iter = m_scriptSchedule.First();
while (!m_scriptSchedule.Empty() && (iter.Key <= Global.WorldMgr.GetGameTime()))
while (!m_scriptSchedule.Empty() && (iter.Key <= GameTime.GetGameTime()))
{
ScriptAction step = iter.Value;