From 7ef7f7fa82f88d0549c1d103bb1ab3f466bc4bf1 Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 23 May 2009 11:17:15 -0500 Subject: *Fix a crash caused by RecalculateAmount when aura caster is not present. --HG-- branch : trunk --- src/game/SpellAuras.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index e0c6184d695..0c9acbec4b6 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -851,7 +851,7 @@ void AuraEffect::ApplyModifier(bool apply, bool Real, bool changeAmount) void AuraEffect::RecalculateAmount(bool applied) { Unit *caster = GetParentAura()->GetCaster(); - int32 amount = GetParentAura()->GetStackAmount() * caster->CalculateSpellDamage(m_spellProto, GetEffIndex(), GetBasePoints(), m_target); + int32 amount = GetParentAura()->GetStackAmount() * (caster ? caster->CalculateSpellDamage(m_spellProto, GetEffIndex(), GetBasePoints(), NULL) : GetBasePoints()); // Reapply if amount change if (amount!=GetAmount()) { @@ -1524,12 +1524,14 @@ void AuraEffect::HandleAddModifier(bool apply, bool Real, bool changeAmount) case SPELLMOD_EFFECT2: case SPELLMOD_EFFECT3: { + uint64 guid = m_target->GetGUID(); Unit::AuraMap & auras = m_target->GetAuras(); for(Unit::AuraMap::iterator iter = auras.begin(); iter != auras.end();++iter) { Aura * aur = iter->second; // only passive auras-active auras should have amount set on spellcast and not be affected - if (aur->IsPassive() && isAffectedOnSpell(aur->GetSpellProto())) + // if aura is casted by others, it will not be affected + if (aur->IsPassive() && aur->GetCasterGUID() == guid && isAffectedOnSpell(aur->GetSpellProto())) { if (modOp == SPELLMOD_ALL_EFFECTS) { -- cgit v1.2.3