aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2021-03-11 20:16:36 +0200
committerGitHub <noreply@github.com>2021-03-11 20:16:36 +0200
commit10304a8875453f989a4f9a073cd4cda57d29c910 (patch)
treec3a8b35201c8298048e49470464302a83edad414 /src
parentd6c83592241e84021e142cd45ed4a6a0b5b7d4d3 (diff)
Core/Spells: Apply UNIT_FLAG_IMMUNE after applying SPELL_AURA_DAMAGE_IMMUNITY (#26187)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp12
1 files changed, 11 insertions, 1 deletions
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