From dea3d44b46f6a885c196856e24046d9b490aa633 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:17:22 -0300 Subject: [PATCH] fix(Core/Spells): Prevent aura application if the target is immune (#20031) --- src/server/game/Spells/Spell.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index e3ae15423..bde6e7b35 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3160,6 +3160,13 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA if (m_spellAura) { + // Prevent aura application if target is immuned + if (m_targets.GetUnitTarget() && m_targets.GetUnitTarget()->IsImmunedToDamageOrSchool(m_spellAura->GetSpellInfo())) + { + m_spellAura->Remove(); + return SPELL_MISS_IMMUNE; + } + // Set aura stack amount to desired value if (m_spellValue->AuraStackAmount > 1) {