mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user