diff options
-rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 3bc572af964..ce4c520cf81 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -3463,12 +3463,17 @@ class spell_gen_turkey_marker : public AuraScript void OnPeriodic(AuraEffect const* /*aurEff*/) { - if (_applyTimes.empty()) - return; + int32 removeCount = 0; + + // pop expired times off of the stack + while (!_applyTimes.empty() && _applyTimes.front() + GetMaxDuration() < GameTime::GetGameTimeMS()) + { + _applyTimes.pop_front(); + removeCount++; + } - // pop stack if it expired for us - if (_applyTimes.front() + GetMaxDuration() < GameTime::GetGameTimeMS()) - ModStackAmount(-1, AURA_REMOVE_BY_EXPIRE); + if (removeCount) + ModStackAmount(-removeCount, AURA_REMOVE_BY_EXPIRE); } void Register() override |