*Some code optimize.
--HG-- branch : trunk
This commit is contained in:
@@ -71,9 +71,12 @@ bool Player::UpdateStats(Stats stat)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Need update (exist AP from stat auras)
|
||||
UpdateAttackPowerAndDamage();
|
||||
UpdateAttackPowerAndDamage(true);
|
||||
if (HasAuraTypeWithMiscvalue(SPELL_AURA_MOD_MEELE_ATTACK_POWER_OF_STAT_PERCENT, stat))
|
||||
UpdateAttackPowerAndDamage(false);
|
||||
if (HasAuraTypeWithMiscvalue(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT, stat))
|
||||
UpdateAttackPowerAndDamage(true);
|
||||
|
||||
UpdateSpellDamageAndHealingBonus();
|
||||
UpdateManaRegen();
|
||||
|
||||
@@ -3403,6 +3403,16 @@ void Unit::DeMorph()
|
||||
SetDisplayId(GetNativeDisplayId());
|
||||
}
|
||||
|
||||
bool Unit::HasAuraTypeWithMiscvalue(AuraType auratype, uint32 miscvalue) const
|
||||
{
|
||||
AuraList const& mTotalAuraList = GetAurasByType(auratype);
|
||||
for(AuraList::const_iterator i = mTotalAuraList.begin();i != mTotalAuraList.end(); ++i)
|
||||
if (miscvalue == (*i)->GetModifier()->m_miscvalue)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int32 Unit::GetTotalAuraModifier(AuraType auratype) const
|
||||
{
|
||||
int32 modifier = 0;
|
||||
|
||||
@@ -1366,6 +1366,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
AuraList const& GetAurasByType(AuraType type) const { return m_modAuras[type]; }
|
||||
void ApplyAuraProcTriggerDamage(Aura* aura, bool apply);
|
||||
|
||||
bool HasAuraTypeWithMiscvalue(AuraType auratype, uint32 miscvalue) const;
|
||||
int32 GetTotalAuraModifier(AuraType auratype) const;
|
||||
float GetTotalAuraMultiplier(AuraType auratype) const;
|
||||
int32 GetMaxPositiveAuraModifier(AuraType auratype) const;
|
||||
|
||||
Reference in New Issue
Block a user