diff options
| author | Shauren <shauren.trinity@gmail.com> | 2025-12-25 16:16:16 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2025-12-25 16:16:16 +0100 |
| commit | 42ebe3b0dc71c915539e458e82e6eed226d79c39 (patch) | |
| tree | ea4a3349fbcbcc3f7e28fa88b7215a90736a7836 /src/server/game/Spells/SpellInfo.cpp | |
| parent | ac266c45b1b24514cbc8a8d1d23119b0820582ae (diff) | |
Core/Spells: Use spell positivity to determine immunities instead of caster-target faction reaction
Diffstat (limited to 'src/server/game/Spells/SpellInfo.cpp')
| -rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 700af4e4b90..185826c720b 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -3649,7 +3649,7 @@ void SpellInfo::ApplyAllSpellImmunitiesTo(Unit* target, SpellEffectInfo const& s if (apply && HasAttribute(SPELL_ATTR1_IMMUNITY_PURGES_EFFECT)) { - target->RemoveAppliedAuras([this, target, schoolImmunity](AuraApplication const* aurApp) -> bool + target->RemoveAppliedAuras([this, schoolImmunity](AuraApplication const* aurApp) -> bool { SpellInfo const* auraSpellInfo = aurApp->GetBase()->GetSpellInfo(); if (auraSpellInfo->Id == Id) // Don't remove self @@ -3660,12 +3660,8 @@ void SpellInfo::ApplyAllSpellImmunitiesTo(Unit* target, SpellEffectInfo const& s return false; if (!CanDispelAura(auraSpellInfo)) return false; - if (!HasAttribute(SPELL_ATTR1_IMMUNITY_TO_HOSTILE_AND_FRIENDLY_EFFECTS)) - { - WorldObject const* existingAuraCaster = aurApp->GetBase()->GetWorldObjectCaster(); - if (existingAuraCaster && existingAuraCaster->IsFriendlyTo(target)) // Check spell vs aura possitivity - return false; - } + if (aurApp->IsPositive() && !HasAttribute(SPELL_ATTR1_IMMUNITY_TO_HOSTILE_AND_FRIENDLY_EFFECTS)) // Check spell vs aura possitivity + return false; return true; }); } |
