aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp31
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.h2
2 files changed, 18 insertions, 15 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index f17deb515b1..f1cbd7f79d5 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -400,7 +400,7 @@ void AuraEffect::GetTargetList(std::list<Unit *> & targetList) const
}
}
-void AuraEffect::GetApplicationList(std::list<AuraApplication *> & applicationList) const
+void AuraEffect::GetApplicationList(std::list<AuraApplication* const> & applicationList) const
{
Aura::ApplicationMap const & targetMap = GetBase()->GetApplicationMap();
// remove all targets which were not added to new list - they no longer deserve area aura
@@ -950,12 +950,14 @@ void AuraEffect::ChangeAmount(int32 newAmount, bool mark, bool onStackOrReapply)
handleMask |= AURA_EFFECT_HANDLE_REAPPLY;
if (!handleMask)
return;
- UnitList targetList;
- GetTargetList(targetList);
- for (UnitList::iterator aurEffTarget = targetList.begin(); aurEffTarget != targetList.end(); ++aurEffTarget)
- {
- HandleEffect(*aurEffTarget, handleMask, false);
- }
+
+ std::list<AuraApplication* const> effectApplications;
+ GetApplicationList(effectApplications);
+
+ for (std::list<AuraApplication* const>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
+ if ((*apptItr)->HasEffect(GetEffIndex()))
+ HandleEffect(*apptItr, handleMask, false);
+
if (handleMask & AURA_EFFECT_HANDLE_REAPPLY)
{
if (!mark)
@@ -964,10 +966,10 @@ void AuraEffect::ChangeAmount(int32 newAmount, bool mark, bool onStackOrReapply)
SetAmount(newAmount);
CalculateSpellMod();
}
- for (UnitList::iterator aurEffTarget = targetList.begin(); aurEffTarget != targetList.end(); ++aurEffTarget)
- {
- HandleEffect(*aurEffTarget, handleMask, true);
- }
+
+ for (std::list<AuraApplication* const>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
+ if ((*apptItr)->HasEffect(GetEffIndex()))
+ HandleEffect(*apptItr, handleMask, true);
}
void AuraEffect::HandleEffect(AuraApplication const * aurApp, uint8 mode, bool apply)
@@ -1094,11 +1096,12 @@ void AuraEffect::Update(uint32 diff, Unit * caster)
m_periodicTimer += m_amplitude - diff;
UpdatePeriodic(caster);
- std::list<AuraApplication*> effectApplications;
+ std::list<AuraApplication* const> effectApplications;
GetApplicationList(effectApplications);
// tick on targets of effects
- for (std::list<AuraApplication*>::iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
- PeriodicTick(*apptItr, caster);
+ for (std::list<AuraApplication* const>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
+ if ((*apptItr)->HasEffect(GetEffIndex()))
+ PeriodicTick(*apptItr, caster);
}
}
}
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h
index b03315b4ea2..89c6b8bb0fd 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.h
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.h
@@ -24,7 +24,7 @@ class AuraEffect
uint64 GetCasterGUID() const { return GetBase()->GetCasterGUID(); }
Aura * GetBase() const { return m_base; }
void GetTargetList(std::list<Unit*> & targetList) const;
- void GetApplicationList(std::list<AuraApplication*> & applicationList) const;
+ void GetApplicationList(std::list<AuraApplication* const> & applicationList) const;
SpellEntry const * GetSpellProto() const { return m_spellProto; }
uint32 GetId() const { return m_spellProto->Id; }