From 49b88a14a9014a0beb77b4beae8b3463b9f29945 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Tue, 4 Aug 2009 23:33:33 +0400 Subject: [PATCH] For check allowed in dead state auras apply use IsDeathPersistentSpell instead hack code. --- src/game/SpellEffects.cpp | 2 +- src/game/Unit.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index e17753622..9c3b63e89 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2354,7 +2354,7 @@ void Spell::EffectApplyAura(uint32 i) return; // ghost spell check, allow apply any auras at player loading in ghost mode (will be cleanup after load) - if( !unitTarget->isAlive() && m_spellInfo->Id != 20584 && m_spellInfo->Id != 8326 && + if( !unitTarget->isAlive() && !IsDeathPersistentSpell(m_spellInfo) && (unitTarget->GetTypeId()!=TYPEID_PLAYER || !((Player*)unitTarget)->GetSession()->PlayerLoading()) ) return; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 36f839f5f..a269f582c 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3406,8 +3406,10 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_ bool Unit::AddAura(Aura *Aur) { + SpellEntry const* aurSpellInfo = Aur->GetSpellProto(); + // ghost spell check, allow apply any auras at player loading in ghost mode (will be cleanup after load) - if( !isAlive() && Aur->GetId() != 20584 && Aur->GetId() != 8326 && Aur->GetId() != 2584 && + if( !isAlive() && !IsDeathPersistentSpell(aurSpellInfo) && (GetTypeId()!=TYPEID_PLAYER || !((Player*)this)->GetSession()->PlayerLoading()) ) { delete Aur; @@ -3423,7 +3425,6 @@ bool Unit::AddAura(Aura *Aur) return false; } - SpellEntry const* aurSpellInfo = Aur->GetSpellProto(); AuraType aurName = Aur->GetModifier()->m_auraname; spellEffectPair spair = spellEffectPair(Aur->GetId(), Aur->GetEffIndex());