From 5808c12f5e9112f565c35a4a1f1ad76b4a9049cd Mon Sep 17 00:00:00 2001 From: QAston Date: Wed, 11 Mar 2009 21:51:24 +0100 Subject: [PATCH] *Fix crash. --HG-- branch : trunk --- src/game/SpellAuras.cpp | 5 +++++ src/game/SpellAuras.h | 1 + src/game/Unit.cpp | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 0f93e915ad..e361f09aa2 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1010,6 +1010,11 @@ void Aura::SetStackAmount(uint8 stackAmount) RefreshAura(); } +void Aura::InitStackAmount(uint8 stackAmount) +{ + m_stackAmount = stackAmount; +} + bool Aura::modStackAmount(int32 num) { // Can`t mod diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index 2c0563e2c0..3534fac5c9 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -279,6 +279,7 @@ class TRINITY_DLL_SPEC Aura //int32 GetModifierValuePerStack() {return m_modifier.m_amount / m_stackAmount;} void SetStackAmount(uint8 num); bool modStackAmount(int32 num); // return true if last charge dropped + void InitStackAmount(uint8 stackAmount); uint32 GetAuraStateMask(){return m_auraStateMask;} void SetAuraState(uint8 num){m_auraStateMask |= 1<<(num-1);} //modifies aura's aura state (not unit!) void RefreshAura(); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 58d419de98..85661e97db 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3795,9 +3795,9 @@ bool Unit::AddAura(Aura *Aur) { // prevent adding stack more than once stackModified=true; - Aur->SetStackAmount(i2->second->GetStackAmount()); + Aur->InitStackAmount(i2->second->GetStackAmount()); if(Aur->GetStackAmount() < aurSpellInfo->StackAmount) - Aur->SetStackAmount(Aur->GetStackAmount()+1); + Aur->InitStackAmount(Aur->GetStackAmount()+1); } RemoveAura(i2,AURA_REMOVE_BY_STACK); i2=m_Auras.lower_bound(spair);