From ee99e76fa9099b5a3ed21fb5b9101ce0ae33da75 Mon Sep 17 00:00:00 2001 From: ariel- Date: Sat, 3 Sep 2022 09:41:48 +0200 Subject: [PATCH] Core/Auras: fix auras apply on player when loading. Fixes Ghost aura flags and player deathstate --- src/server/game/Spells/Auras/SpellAuras.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index b1aed03bdbd..57f98a4fa62 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -2446,8 +2446,14 @@ void UnitAura::FillTargetMap(std::unordered_map& targets, Unit* ca // 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 (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex) {