aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-23 11:17:15 -0500
committermegamage <none@none>2009-05-23 11:17:15 -0500
commit7ef7f7fa82f88d0549c1d103bb1ab3f466bc4bf1 (patch)
treebbb759675f5c39c032eb36aa86fc4b2c9e2add4a /src
parenta22aedf3209f62fc93871568cf052730a0320c17 (diff)
*Fix a crash caused by RecalculateAmount when aura caster is not present.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/SpellAuras.cpp6
1 files changed, 4 insertions, 2 deletions
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)
{