From ba6cccfce7bf886cb3a2678a050a1c497b377da7 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 5 May 2021 16:14:22 -0400 Subject: [PATCH] Core/Auras: Fixed possible crash on login with SPELL_EFFECT_APPLY_AREA_AURA_SUMMONS Port From (https://github.com/TrinityCore/TrinityCore/commit/3169695247f723a4202373e9aba963fe2fe97024) --- Source/Game/Spells/Auras/Aura.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Game/Spells/Auras/Aura.cs b/Source/Game/Spells/Auras/Aura.cs index c623e5ace..491b4b946 100644 --- a/Source/Game/Spells/Auras/Aura.cs +++ b/Source/Game/Spells/Auras/Aura.cs @@ -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; } }