Core/Misc: Fix a couple of warnings, some of them performance related
Errors were found using Cppcheck, open-source static analysis tool
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user