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 a0c07655eb)
This commit is contained in:
Alan Deutscher
2020-01-14 10:49:32 -08:00
committed by Shauren
parent 9b79d1b410
commit cd72ecce78

View File

@@ -3399,12 +3399,17 @@ class spell_gen_turkey_marker : public AuraScript
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
if (_applyTimes.empty())
return;
int32 removeCount = 0;
// pop stack if it expired for us
if (_applyTimes.front() + GetMaxDuration() < GameTime::GetGameTimeMS())
ModStackAmount(-1, AURA_REMOVE_BY_EXPIRE);
// pop expired times off of the stack
while (!_applyTimes.empty() && _applyTimes.front() + GetMaxDuration() < GameTime::GetGameTimeMS())
{
_applyTimes.pop_front();
removeCount++;
}
if (removeCount)
ModStackAmount(-removeCount, AURA_REMOVE_BY_EXPIRE);
}
void Register() override