fix(Core/Spells): Prevent aura application if the target is immune (#20031)

This commit is contained in:
Andrew 2024-09-24 15:17:22 -03:00 committed by GitHub
parent 97aaf8490c
commit dea3d44b46
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)
{