aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-03-15 13:44:24 -0300
committerariel- <ariel-@users.noreply.github.com>2017-03-15 13:44:24 -0300
commit5eac21098efa35f3c6807a57bc44cc887c0cbc6a (patch)
tree7db2db340660ca9317311c46b890ebb18b5c2f10 /src
parentc1afabbf038ee2ebefa06871f1007d489f5d570d (diff)
Core/Auras: use vectors and remove HasEffect check
- Already checked in GetApplicationList
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp20
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 8aae3682d74..7269e61db5f 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -607,12 +607,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)
{
@@ -623,9 +622,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);
}
void AuraEffect::HandleEffect(AuraApplication * aurApp, uint8 mode, bool apply)
@@ -752,12 +750,12 @@ void AuraEffect::Update(uint32 diff, Unit* caster)
m_periodicTimer += m_amplitude - 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);
}
}
}