aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2021-05-05 21:32:15 +0200
committerShauren <shauren.trinity@gmail.com>2021-05-05 21:32:15 +0200
commit3169695247f723a4202373e9aba963fe2fe97024 (patch)
treed4c3906dc3886a03d4c24e47ad3d1425c28c9d89
parent50499c11cf75554cb4951993e9398241d8034337 (diff)
Core/Auras: Fixed possible crash on login with SPELL_EFFECT_APPLY_AREA_AURA_SUMMONS
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index 8f9d716a304..e6c2dc87284 100644
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -2382,9 +2382,11 @@ void UnitAura::FillTargetMap(std::unordered_map<Unit*, uint32>& targets, Unit* c
case SPELL_EFFECT_APPLY_AREA_AURA_SUMMONS:
{
units.push_back(GetUnitOwner());
- Trinity::WorldObjectSpellAreaTargetCheck check(radius, GetUnitOwner(), caster, GetUnitOwner(), m_spellInfo, TARGET_CHECK_SUMMONED, nullptr, TARGET_OBJECT_TYPE_UNIT);
+ Trinity::WorldObjectSpellAreaTargetCheck check(radius, GetUnitOwner(), caster, GetUnitOwner(), m_spellInfo, TARGET_CHECK_SUMMONED, effect->ImplicitTargetConditions, TARGET_OBJECT_TYPE_UNIT);
Trinity::UnitListSearcher<Trinity::WorldObjectSpellAreaTargetCheck> searcher(GetUnitOwner(), units, check);
Cell::VisitAllObjects(GetUnitOwner(), searcher, radius);
+ // by design WorldObjectSpellAreaTargetCheck allows not-in-world units (for spells) but for auras it is not acceptable
+ units.erase(std::remove_if(units.begin(), units.end(), [caster](Unit* unit) { return !unit->IsSelfOrInSameMap(caster); }), units.end());
break;
}
}