[8136] Fixed aura refresh on modify stack by negative amount.

When decreasing stack amount of aura, aura should not be
refreshed to full time. This should only happen on increasing
stack.

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
ApoC 2009-07-06 00:03:51 +02:00
parent 5d8bd14d38
commit 84e46d76e3
2 changed files with 25 additions and 16 deletions

View file

@ -1178,12 +1178,16 @@ void Aura::SendAuraUpdate(bool remove)
void Aura::SetStackAmount(uint8 stackAmount)
{
if (stackAmount != m_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
@ -1193,8 +1197,13 @@ void Aura::SetStackAmount(uint8 stackAmount)
m_modifier.m_amount = amount;
ApplyModifier(true, true);
}
}
if (refresh)
// Stack increased refresh duration
RefreshAura();
else
// Stack decreased only send update
SendAuraUpdate(false);
}
bool Aura::modStackAmount(int32 num)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8135"
#define REVISION_NR "8136"
#endif // __REVISION_NR_H__