mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-18 22:09:40 -04:00
*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);
|
||||
}
|
||||
|
||||
void AuraEffect::RecalculateAmount()
|
||||
void AuraEffect::RecalculateAmount(bool applied)
|
||||
{
|
||||
Unit *caster = GetParentAura()->GetCaster();
|
||||
int32 amount = GetParentAura()->GetStackAmount() * caster->CalculateSpellDamage(m_spellProto, GetEffIndex(), GetBasePoints(), m_target);
|
||||
@@ -856,9 +856,11 @@ void AuraEffect::RecalculateAmount()
|
||||
if (amount!=GetAmount())
|
||||
{
|
||||
// Auras which are applying spellmod should have removed spellmods for real
|
||||
ApplyModifier(false,false,true);
|
||||
if (applied)
|
||||
ApplyModifier(false,false,true);
|
||||
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)
|
||||
{
|
||||
@@ -1204,7 +1206,7 @@ void Aura::SetStackAmount(uint8 stackAmount)
|
||||
{
|
||||
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; }
|
||||
|
||||
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
|
||||
uint32 GetAuraStateMask(){return m_auraStateMask;}
|
||||
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:
|
||||
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
|
||||
void HandleNULL(bool, bool, bool)
|
||||
{
|
||||
@@ -351,7 +351,7 @@ class TRINITY_DLL_SPEC AuraEffect
|
||||
bool isAffectedOnSpell(SpellEntry const *spell) const;
|
||||
|
||||
void ApplyModifier(bool apply, bool Real = false, bool changeAmount=false);
|
||||
void RecalculateAmount();
|
||||
void RecalculateAmount(bool applied = true);
|
||||
void HandleAuraEffect(bool apply);
|
||||
void ApplyAllModifiers(bool apply, bool Real);
|
||||
|
||||
|
||||
+1
-1
@@ -3818,7 +3818,7 @@ bool Unit::AddAura(Aura *Aur, bool handleEffects)
|
||||
uint8 stackAmount = foundAura->GetStackAmount() + 1;
|
||||
if (stackAmount > aurSpellInfo->StackAmount)
|
||||
stackAmount = aurSpellInfo->StackAmount;
|
||||
Aur->SetStackAmount(stackAmount);
|
||||
Aur->SetStackAmount(stackAmount, false);
|
||||
RemoveAura(foundAura, AURA_REMOVE_BY_STACK);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user