From de11b9e901d1d1caa0634fad541f08f11c5781af Mon Sep 17 00:00:00 2001 From: megamage Date: Wed, 29 Apr 2009 00:26:07 -0500 Subject: [7730] Some optimizantion and code style. Author: zhenya --HG-- branch : trunk --- src/game/StatSystem.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/game/StatSystem.cpp') diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index c24999e8fe5..4cf93760957 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -132,13 +132,13 @@ void Player::UpdateSpellDamageAndHealingBonus() // Get healing bonus for all schools SetStatInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, SpellBaseHealingBonus(SPELL_SCHOOL_MASK_ALL)); // Get damage bonus for all schools - for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; i++) + for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) SetStatInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i, SpellBaseDamageBonus(SpellSchoolMask(1 << i))); } bool Player::UpdateAllStats() { - for (int i = STAT_STRENGTH; i < MAX_STATS; i++) + for (int i = STAT_STRENGTH; i < MAX_STATS; ++i) { float value = GetTotalStatValue(Stats(i)); SetStat(Stats(i), (int32)value); @@ -149,7 +149,7 @@ bool Player::UpdateAllStats() UpdateArmor(); UpdateMaxHealth(); - for(int i = POWER_MANA; i < MAX_POWERS; i++) + for(int i = POWER_MANA; i < MAX_POWERS; ++i) UpdateMaxPower(Powers(i)); UpdateAllCritPercentages(); @@ -160,7 +160,7 @@ bool Player::UpdateAllStats() UpdateManaRegen(); UpdateExpertise(BASE_ATTACK); UpdateExpertise(OFF_ATTACK); - for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; i++) + for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i) UpdateResistances(i); return true; @@ -638,7 +638,7 @@ void Player::UpdateSpellHitChances() void Player::UpdateAllSpellCritChances() { - for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; i++) + for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i) UpdateSpellCritChance(i); } @@ -925,13 +925,13 @@ bool Pet::UpdateStats(Stats stat) bool Pet::UpdateAllStats() { - for (int i = STAT_STRENGTH; i < MAX_STATS; i++) + for (int i = STAT_STRENGTH; i < MAX_STATS; ++i) UpdateStats(Stats(i)); - for(int i = POWER_MANA; i < MAX_POWERS; i++) + for(int i = POWER_MANA; i < MAX_POWERS; ++i) UpdateMaxPower(Powers(i)); - for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; i++) + for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i) UpdateResistances(i); return true; -- cgit v1.2.3