diff options
Diffstat (limited to 'src/server/game/Spells/SpellInfo.cpp')
-rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 4d5e6ca4d2c..02225a00b81 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -3595,15 +3595,19 @@ void SpellInfo::ApplyAllSpellImmunitiesTo(Unit* target, SpellEffectInfo const& s target->RemoveAurasWithMechanic(mechanicImmunity, AURA_REMOVE_BY_DEFAULT, Id); else { - target->RemoveAppliedAuras([mechanicImmunity](AuraApplication const* aurApp) + std::vector<Aura*> aurasToUpdateTargets; + target->RemoveAppliedAuras([mechanicImmunity, &aurasToUpdateTargets](AuraApplication const* aurApp) { Aura* aura = aurApp->GetBase(); if (aura->GetSpellInfo()->GetAllEffectsMechanicMask() & mechanicImmunity) - aura->UpdateTargetMap(aura->GetCaster()); + aurasToUpdateTargets.push_back(aura); // only update targets, don't remove anything return false; }); + + for (Aura* aura : aurasToUpdateTargets) + aura->UpdateTargetMap(aura->GetCaster()); } } } |