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:
hondacrx
2021-05-05 16:14:22 -04:00
parent 41bee924d3
commit ba6cccfce7
+3 -1
View File
@@ -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;
}
}