Core/Auras: Fix problem with aura charges introduced on 42a20f1 with the reuse of existing aura objects on aura reapply.
Closes #1989 Closes #2039 Closes #2211
This commit is contained in:
@@ -41,6 +41,7 @@ class AuraEffect
|
|||||||
Aura * GetBase() const { return m_base; }
|
Aura * GetBase() const { return m_base; }
|
||||||
void GetTargetList(std::list<Unit*> & targetList) const;
|
void GetTargetList(std::list<Unit*> & targetList) const;
|
||||||
void GetApplicationList(std::list<AuraApplication*> & applicationList) const;
|
void GetApplicationList(std::list<AuraApplication*> & applicationList) const;
|
||||||
|
SpellModifier* GetSpellModifier() const { return m_spellmod; }
|
||||||
|
|
||||||
SpellEntry const* GetSpellProto() const { return m_spellProto; }
|
SpellEntry const* GetSpellProto() const { return m_spellProto; }
|
||||||
uint32 GetId() const { return m_spellProto->Id; }
|
uint32 GetId() const { return m_spellProto->Id; }
|
||||||
|
|||||||
@@ -831,6 +831,12 @@ bool Aura::ModStackAmount(int32 num, AuraRemoveMode removeMode)
|
|||||||
|
|
||||||
// reset charges
|
// reset charges
|
||||||
SetCharges(CalcMaxCharges());
|
SetCharges(CalcMaxCharges());
|
||||||
|
// FIXME: not a best way to synchronize charges, but works
|
||||||
|
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||||
|
if (AuraEffect* aurEff = GetEffect(i))
|
||||||
|
if (aurEff->GetAuraType() == SPELL_AURA_ADD_FLAT_MODIFIER || aurEff->GetAuraType() == SPELL_AURA_ADD_PCT_MODIFIER)
|
||||||
|
if (SpellModifier* mod = aurEff->GetSpellModifier())
|
||||||
|
mod->charges = GetCharges();
|
||||||
}
|
}
|
||||||
SetNeedClientUpdateForTargets();
|
SetNeedClientUpdateForTargets();
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user