From a509aea659c3c488617fd396489f52dc8c64a3e8 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 4 Jan 2013 23:13:21 +0000 Subject: Core/Misc: Fix a couple of warnings, some of them performance related Errors were found using Cppcheck, open-source static analysis tool --- src/server/game/Entities/Unit/StatSystem.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/server/game/Entities/Unit') 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 -- cgit v1.2.3