mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-04 08:07:09 +01:00
Core/Auras: use vectors and remove HasEffect check
- Already checked in GetApplicationList
This commit is contained in:
@@ -705,12 +705,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)
|
||||
{
|
||||
@@ -721,9 +720,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)
|
||||
@@ -850,12 +848,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user