From 10304a8875453f989a4f9a073cd4cda57d29c910 Mon Sep 17 00:00:00 2001 From: offl <11556157+offl@users.noreply.github.com> Date: Thu, 11 Mar 2021 20:16:36 +0200 Subject: Core/Spells: Apply UNIT_FLAG_IMMUNE after applying SPELL_AURA_DAMAGE_IMMUNITY (#26187) --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/server') diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index c8c245a421b..46af96aaef1 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -3175,7 +3175,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint else { // do not remove unit flag if there are more than this auraEffect of that kind on unit - if (target->HasAuraType(GetAuraType())) + if (target->HasAuraType(GetAuraType()) || target->HasAuraType(SPELL_AURA_DAMAGE_IMMUNITY)) return; target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE); } @@ -3190,7 +3190,17 @@ void AuraEffect::HandleAuraModDmgImmunity(AuraApplication const* aurApp, uint8 m m_spellInfo->ApplyAllSpellImmunitiesTo(target, GetEffIndex(), apply); if (apply) + { + target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE); target->GetThreatManager().EvaluateSuppressed(); + } + else + { + // do not remove unit flag if there are more than this auraEffect of that kind on unit + if (target->HasAuraType(GetAuraType()) || target->HasAuraType(SPELL_AURA_SCHOOL_IMMUNITY)) + return; + target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE); + } } void AuraEffect::HandleAuraModDispelImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const -- cgit v1.2.3