Core/Spells: Fixed spell with SPELL_AURA_MECHANIC_IMMUNITY_MASK failing to cast if they were supposed to purge effect they are granting immunity to (CreatureImmunities was not checked)

Port From (https://github.com/TrinityCore/TrinityCore/commit/e1e4aa7980a6e91a330d615467b2c25b60dcbcc1)
This commit is contained in:
Hondacrx
2024-08-26 16:24:24 -04:00
parent f908481bce
commit 7946aa1958
2 changed files with 65 additions and 75 deletions
+7 -7
View File
@@ -2772,6 +2772,13 @@ namespace Game.Spells
targets.Add(target, targetPair.Value);
}
// skip area update if owner is not in world!
if (!GetUnitOwner().IsInWorld)
return;
if (GetUnitOwner().HasAuraState(AuraStateType.Banished, GetSpellInfo(), caster))
return;
foreach (var spellEffectInfo in GetSpellInfo().GetEffects())
{
if (!HasEffect(spellEffectInfo.EffectIndex))
@@ -2781,13 +2788,6 @@ namespace Game.Spells
if (spellEffectInfo.Effect == SpellEffectName.ApplyAura)
continue;
// skip area update if owner is not in world!
if (!GetUnitOwner().IsInWorld)
continue;
if (GetUnitOwner().HasAuraState(AuraStateType.Banished, GetSpellInfo(), caster))
continue;
List<WorldObject> units = new();
var condList = spellEffectInfo.ImplicitTargetConditions;