diff options
| author | Nay <dnpd.dd@gmail.com> | 2013-01-04 23:13:21 +0000 |
|---|---|---|
| committer | Nay <dnpd.dd@gmail.com> | 2013-01-04 23:14:14 +0000 |
| commit | a509aea659c3c488617fd396489f52dc8c64a3e8 (patch) | |
| tree | 87de8c68bf03311f691c40120dbd59458c457691 /src/server/game/Entities/Unit | |
| parent | e0a5aabaf76359fd6e537ad06d4663924766e9d2 (diff) | |
Core/Misc: Fix a couple of warnings, some of them performance related
Errors were found using Cppcheck, open-source static analysis tool
Diffstat (limited to 'src/server/game/Entities/Unit')
| -rw-r--r-- | src/server/game/Entities/Unit/StatSystem.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 1bd7c1b217d..5cf0550905c 100644 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -200,10 +200,9 @@ void Player::UpdateResistances(uint32 school) void Player::UpdateArmor() { - float value = 0.0f; UnitMods unitMod = UNIT_MOD_ARMOR; - value = GetModifierValue(unitMod, BASE_VALUE); // base armor (from items) + float value = GetModifierValue(unitMod, BASE_VALUE); // base armor (from items) value *= GetModifierValue(unitMod, BASE_PCT); // armor percent from items value += GetStat(STAT_AGILITY) * 2.0f; // armor bonus from stats value += GetModifierValue(unitMod, TOTAL_VALUE); @@ -1091,10 +1090,9 @@ bool Guardian::UpdateStats(Stats stat) case STAT_STRENGTH: mod = 0.7f; break; // Default Owner's Strength scale default: break; } - // Ravenous Dead - AuraEffect const* aurEff = NULL; + // Check just if owner has Ravenous Dead since it's effect is not an aura - aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0); + AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0); if (aurEff) { SpellInfo const* spellInfo = aurEff->GetSpellInfo(); // Then get the SpellProto and add the dummy effect value |
