From 071d112ed1f84c5be502f3121a3f362b913f33e2 Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 12 Mar 2018 02:59:57 -0300 Subject: Core/Auras: fix auras apply on player when loading. Fixes Ghost aura flags and player deathstate Closes #21472 (cherry picked from commit 214fd579c0b53885d22ab49b90201060a794f039) --- src/server/game/Spells/Auras/SpellAuras.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index bead326338d..f17f44377e7 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -2387,8 +2387,14 @@ void UnitAura::FillTargetMap(std::unordered_map& targets, Unit* c // add non area aura targets // static applications go through spell system first, so we assume they meet conditions for (auto const& targetPair : _staticApplications) - if (Unit* target = ObjectAccessor::GetUnit(*GetUnitOwner(), targetPair.first)) + { + Unit* target = ObjectAccessor::GetUnit(*GetUnitOwner(), targetPair.first); + if (!target && targetPair.first == GetUnitOwner()->GetGUID()) + target = GetUnitOwner(); + + if (target) targets.emplace(target, targetPair.second); + } for (SpellEffectInfo const& spellEffectInfo : GetSpellInfo()->GetEffects()) { -- cgit v1.2.3