aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Deutscher <adeutscher@gmail.com>2020-01-14 10:49:32 -0800
committerShauren <shauren.trinity@gmail.com>2021-12-20 21:24:37 +0100
commitcd72ecce78b3152b8db62c96e90cb9d14ea5e565 (patch)
tree6051553635422b4056a3fe2ac73be6b1968020b6
parent9b79d1b410de03cd74fee90d952dcb37b82e257b (diff)
Scripts/Spells: fix Turkey Timer duration (#24048)
* spell_gen_turkey_marker::OnPeriodic: Pop expired stack timestamps from tracking list. * Be a bit more explicit about the data type of removedCount. * Formatting nudge. * Remove brackets. (cherry picked from commit a0c07655eb6b42a2e1fd9319d53c7ed7f2c585d8)
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp15
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 81bab4a1772..09f08d50b28 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -3399,12 +3399,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