From 45eda48693af96a3b5131c4f35e2fe94689b90d0 Mon Sep 17 00:00:00 2001 From: ApoC Date: Sat, 11 Jul 2009 18:11:06 +0200 Subject: [PATCH] [8161] Partial revert and fix of my prev. commit in Aura::SetStackAmount * Aura should be refreshed also when stackAmount == m_stackAmount this fixing problem that aura not refreshed if you have already full stack and cast "stack spell" again on target Thanks Corfen for problem reporting and testing Signed-off-by: ApoC --- src/game/SpellAuras.cpp | 23 +++++++++++------------ src/shared/revision_nr.h | 2 +- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index df1cd5497..59595941f 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1178,24 +1178,23 @@ void Aura::SendAuraUpdate(bool remove) void Aura::SetStackAmount(uint8 stackAmount) { - if (stackAmount == m_stackAmount) - // Nothing changed - return; - Unit *target = GetTarget(); Unit *caster = GetCaster(); if (!target || !caster) return; - bool refresh = stackAmount > m_stackAmount; - m_stackAmount = stackAmount; - int32 amount = m_stackAmount * caster->CalculateSpellDamage(m_spellProto, m_effIndex, m_currentBasePoints, target); - // Reapply if amount change - if (amount!=m_modifier.m_amount) + bool refresh = stackAmount >= m_stackAmount; + if (stackAmount != m_stackAmount) { - ApplyModifier(false, true); - m_modifier.m_amount = amount; - ApplyModifier(true, true); + m_stackAmount = stackAmount; + int32 amount = m_stackAmount * caster->CalculateSpellDamage(m_spellProto, m_effIndex, m_currentBasePoints, target); + // Reapply if amount change + if (amount!=m_modifier.m_amount) + { + ApplyModifier(false, true); + m_modifier.m_amount = amount; + ApplyModifier(true, true); + } } if (refresh) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 2bc67073e..839956c12 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8160" + #define REVISION_NR "8161" #endif // __REVISION_NR_H__