aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
authorxinef1 <w.szyszko2@gmail.com>2017-03-02 02:19:25 +0100
committerShauren <shauren.trinity@gmail.com>2019-08-17 20:04:14 +0200
commit60663d1374beef3103f4787152654034fa4a8897 (patch)
tree38e07d44442ad903a9729536942e8e253a072274 /src/server/scripts/Spells
parent98180ecdc179386270e93b80c0db8344b659557f (diff)
Ensure that all actions are compared to fixed point in time (ie. world update start) (#18910)
- Actions will not be dependent on processing moment - Increased GameObjects cooldown resolution to milliseconds, fixes arming time of traps to be exactly one second and not something from range (1000, 1999) - Created GameTime namespace and UpdateTime class and moved there some code out of world (cherrypicked from 7567cafec84080d26ea513242a1f540a823b8f9d)
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index bbf86c4d9be..148009a780a 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -26,6 +26,7 @@
#include "Battleground.h"
#include "CellImpl.h"
#include "DB2Stores.h"
+#include "GameTime.h"
#include "GridNotifiersImpl.h"
#include "Group.h"
#include "InstanceScript.h"
@@ -3589,7 +3590,7 @@ class spell_gen_turkey_marker : public SpellScriptLoader
void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
// store stack apply times, so we can pop them while they expire
- _applyTimes.push_back(getMSTime());
+ _applyTimes.push_back(GameTime::GetGameTimeMS());
Unit* target = GetTarget();
// on stack 15 cast the achievement crediting spell
@@ -3603,7 +3604,7 @@ class spell_gen_turkey_marker : public SpellScriptLoader
return;
// pop stack if it expired for us
- if (_applyTimes.front() + GetMaxDuration() < getMSTime())
+ if (_applyTimes.front() + GetMaxDuration() < GameTime::GetGameTimeMS())
ModStackAmount(-1, AURA_REMOVE_BY_EXPIRE);
}