For check allowed in dead state auras apply use IsDeathPersistentSpell instead hack code.

This commit is contained in:
VladimirMangos 2009-08-04 23:33:33 +04:00
parent 6db608d1d3
commit 49b88a14a9
2 changed files with 4 additions and 3 deletions

View file

@ -2354,7 +2354,7 @@ void Spell::EffectApplyAura(uint32 i)
return; return;
// ghost spell check, allow apply any auras at player loading in ghost mode (will be cleanup after load) // 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()) ) (unitTarget->GetTypeId()!=TYPEID_PLAYER || !((Player*)unitTarget)->GetSession()->PlayerLoading()) )
return; return;

View file

@ -3406,8 +3406,10 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_
bool Unit::AddAura(Aura *Aur) 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) // 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()) ) (GetTypeId()!=TYPEID_PLAYER || !((Player*)this)->GetSession()->PlayerLoading()) )
{ {
delete Aur; delete Aur;
@ -3423,7 +3425,6 @@ bool Unit::AddAura(Aura *Aur)
return false; return false;
} }
SpellEntry const* aurSpellInfo = Aur->GetSpellProto();
AuraType aurName = Aur->GetModifier()->m_auraname; AuraType aurName = Aur->GetModifier()->m_auraname;
spellEffectPair spair = spellEffectPair(Aur->GetId(), Aur->GetEffIndex()); spellEffectPair spair = spellEffectPair(Aur->GetId(), Aur->GetEffIndex());