diff options
author | ariel- <ariel-@users.noreply.github.com> | 2017-03-15 13:44:24 -0300 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2019-08-17 20:04:14 +0200 |
commit | 586a450ec96ac982d134471ac51f960ab52bbadb (patch) | |
tree | 6ff2d9bd0c11e0955985af3ec17644a6b4be33f0 | |
parent | 13e79117d98b2ec091c4b223f24dfc0b4b0369e7 (diff) |
Core/Auras: use vectors and remove HasEffect check
- Already checked in GetApplicationList
(cherrypicked from 5eac21098efa35f3c6807a57bc44cc887c0cbc6a)
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index dac41685c72..53452b767d6 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -771,12 +771,11 @@ void AuraEffect::ChangeAmount(int32 newAmount, bool mark, bool onStackOrReapply) if (!handleMask) return; - std::list<AuraApplication*> effectApplications; + std::vector<AuraApplication*> effectApplications; GetApplicationList(effectApplications); - for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr) - if ((*apptItr)->HasEffect(GetEffIndex())) - HandleEffect(*apptItr, handleMask, false); + for (AuraApplication* aurApp : effectApplications) + HandleEffect(aurApp, handleMask, false); if (handleMask & AURA_EFFECT_HANDLE_CHANGE_AMOUNT) { @@ -787,9 +786,8 @@ void AuraEffect::ChangeAmount(int32 newAmount, bool mark, bool onStackOrReapply) CalculateSpellMod(); } - for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr) - if ((*apptItr)->HasEffect(GetEffIndex())) - HandleEffect(*apptItr, handleMask, true); + for (AuraApplication* aurApp : effectApplications) + HandleEffect(aurApp, handleMask, true); if (GetSpellInfo()->HasAttribute(SPELL_ATTR8_AURA_SEND_AMOUNT)) GetBase()->SetNeedClientUpdateForTargets(); @@ -931,12 +929,12 @@ void AuraEffect::Update(uint32 diff, Unit* caster) m_periodicTimer += m_period - diff; UpdatePeriodic(caster); - std::list<AuraApplication*> effectApplications; + std::vector<AuraApplication*> effectApplications; GetApplicationList(effectApplications); + // tick on targets of effects - for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr) - if ((*apptItr)->HasEffect(GetEffIndex())) - PeriodicTick(*apptItr, caster); + for (AuraApplication* aurApp : effectApplications) + PeriodicTick(aurApp, caster); } } } |