Core/Auras: Fixed possible crash on login with SPELL_EFFECT_APPLY_AREA_AURA_SUMMONS
Port From (https://github.com/TrinityCore/TrinityCore/commit/3169695247f723a4202373e9aba963fe2fe97024)
This commit is contained in:
@@ -2649,9 +2649,11 @@ namespace Game.Spells
|
||||
case SpellEffectName.ApplyAreaAuraSummons:
|
||||
{
|
||||
targetList.Add(GetUnitOwner());
|
||||
WorldObjectSpellAreaTargetCheck check = new(radius, GetUnitOwner(), caster, GetUnitOwner(), GetSpellInfo(), SpellTargetCheckTypes.Summoned, null, SpellTargetObjectTypes.Unit);
|
||||
WorldObjectSpellAreaTargetCheck check = new(radius, GetUnitOwner(), caster, GetUnitOwner(), GetSpellInfo(), SpellTargetCheckTypes.Summoned, effect.ImplicitTargetConditions, SpellTargetObjectTypes.Unit);
|
||||
UnitListSearcher searcher = new(GetUnitOwner(), targetList, check);
|
||||
Cell.VisitAllObjects(GetUnitOwner(), searcher, radius);
|
||||
// by design WorldObjectSpellAreaTargetCheck allows not-in-world units (for spells) but for auras it is not acceptable
|
||||
targetList.RemoveAll(unit => !unit.IsSelfOrInSameMap(caster));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user