*Fix a crash.
--HG-- branch : trunk
This commit is contained in:
@@ -848,7 +848,7 @@ void AuraEffect::ApplyModifier(bool apply, bool Real, bool changeAmount)
|
|||||||
(*this.*AuraHandler [m_auraName])(apply,Real, changeAmount);
|
(*this.*AuraHandler [m_auraName])(apply,Real, changeAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AuraEffect::RecalculateAmount()
|
void AuraEffect::RecalculateAmount(bool applied)
|
||||||
{
|
{
|
||||||
Unit *caster = GetParentAura()->GetCaster();
|
Unit *caster = GetParentAura()->GetCaster();
|
||||||
int32 amount = GetParentAura()->GetStackAmount() * caster->CalculateSpellDamage(m_spellProto, GetEffIndex(), GetBasePoints(), m_target);
|
int32 amount = GetParentAura()->GetStackAmount() * caster->CalculateSpellDamage(m_spellProto, GetEffIndex(), GetBasePoints(), m_target);
|
||||||
@@ -856,9 +856,11 @@ void AuraEffect::RecalculateAmount()
|
|||||||
if (amount!=GetAmount())
|
if (amount!=GetAmount())
|
||||||
{
|
{
|
||||||
// Auras which are applying spellmod should have removed spellmods for real
|
// Auras which are applying spellmod should have removed spellmods for real
|
||||||
ApplyModifier(false,false,true);
|
if (applied)
|
||||||
|
ApplyModifier(false,false,true);
|
||||||
SetAmount(amount);
|
SetAmount(amount);
|
||||||
ApplyModifier(true,false,true);
|
if (applied)
|
||||||
|
ApplyModifier(true,false,true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1195,7 +1197,7 @@ void Aura::_RemoveAura()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Aura::SetStackAmount(uint8 stackAmount)
|
void Aura::SetStackAmount(uint8 stackAmount, bool applied)
|
||||||
{
|
{
|
||||||
if (stackAmount != m_stackAmount)
|
if (stackAmount != m_stackAmount)
|
||||||
{
|
{
|
||||||
@@ -1204,7 +1206,7 @@ void Aura::SetStackAmount(uint8 stackAmount)
|
|||||||
{
|
{
|
||||||
if (AuraEffect * part = GetPartAura(i))
|
if (AuraEffect * part = GetPartAura(i))
|
||||||
{
|
{
|
||||||
part->RecalculateAmount();
|
part->RecalculateAmount(applied);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class TRINITY_DLL_SPEC Aura
|
|||||||
uint32 GetProcDamage() const { return m_procDamage; }
|
uint32 GetProcDamage() const { return m_procDamage; }
|
||||||
|
|
||||||
int8 GetStackAmount() const {return m_stackAmount;}
|
int8 GetStackAmount() const {return m_stackAmount;}
|
||||||
void SetStackAmount(uint8 num);
|
void SetStackAmount(uint8 num, bool applied = true);
|
||||||
bool modStackAmount(int32 num); // return true if last charge dropped
|
bool modStackAmount(int32 num); // return true if last charge dropped
|
||||||
uint32 GetAuraStateMask(){return m_auraStateMask;}
|
uint32 GetAuraStateMask(){return m_auraStateMask;}
|
||||||
void SetAuraState(uint8 num){m_auraStateMask |= 1<<(num-1);} //modifies auras' aura state (not unit!)
|
void SetAuraState(uint8 num){m_auraStateMask |= 1<<(num-1);} //modifies auras' aura state (not unit!)
|
||||||
@@ -172,7 +172,7 @@ class TRINITY_DLL_SPEC AuraEffect
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
friend AuraEffect* CreateAuraEffect(Aura * parentAura, uint32 effIndex, int32 *currentBasePoints, Unit * caster, Item * castItem, Unit * formalCaster);
|
friend AuraEffect* CreateAuraEffect(Aura * parentAura, uint32 effIndex, int32 *currentBasePoints, Unit * caster, Item * castItem, Unit * formalCaster);
|
||||||
friend void Aura::SetStackAmount(uint8 stackAmount);
|
friend void Aura::SetStackAmount(uint8 stackAmount, bool applied);
|
||||||
//aura handlers
|
//aura handlers
|
||||||
void HandleNULL(bool, bool, bool)
|
void HandleNULL(bool, bool, bool)
|
||||||
{
|
{
|
||||||
@@ -351,7 +351,7 @@ class TRINITY_DLL_SPEC AuraEffect
|
|||||||
bool isAffectedOnSpell(SpellEntry const *spell) const;
|
bool isAffectedOnSpell(SpellEntry const *spell) const;
|
||||||
|
|
||||||
void ApplyModifier(bool apply, bool Real = false, bool changeAmount=false);
|
void ApplyModifier(bool apply, bool Real = false, bool changeAmount=false);
|
||||||
void RecalculateAmount();
|
void RecalculateAmount(bool applied = true);
|
||||||
void HandleAuraEffect(bool apply);
|
void HandleAuraEffect(bool apply);
|
||||||
void ApplyAllModifiers(bool apply, bool Real);
|
void ApplyAllModifiers(bool apply, bool Real);
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -3818,7 +3818,7 @@ bool Unit::AddAura(Aura *Aur, bool handleEffects)
|
|||||||
uint8 stackAmount = foundAura->GetStackAmount() + 1;
|
uint8 stackAmount = foundAura->GetStackAmount() + 1;
|
||||||
if (stackAmount > aurSpellInfo->StackAmount)
|
if (stackAmount > aurSpellInfo->StackAmount)
|
||||||
stackAmount = aurSpellInfo->StackAmount;
|
stackAmount = aurSpellInfo->StackAmount;
|
||||||
Aur->SetStackAmount(stackAmount);
|
Aur->SetStackAmount(stackAmount, false);
|
||||||
RemoveAura(foundAura, AURA_REMOVE_BY_STACK);
|
RemoveAura(foundAura, AURA_REMOVE_BY_STACK);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user