From 6767bbc95f46df4b62c8131a39a132d3f9bb8a26 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 17 Jan 2017 20:14:44 +0100 Subject: Fix static analysis issues CID 1291964 CID 1292775 --- src/server/game/Spells/SpellInfo.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/server/game/Spells/SpellInfo.cpp') diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index b6aa0746376..ccc5d81d5c8 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -2598,17 +2598,20 @@ std::vector SpellInfo::CalcPowerCost(Unit const* caster, Sp if (power->HealthCostPercentage) healthCost += int32(CalculatePct(caster->GetMaxHealth(), power->HealthCostPercentage)); - // Flat mod from caster auras by spell school and power type - Unit::AuraEffectList const& auras = caster->GetAuraEffectsByType(SPELL_AURA_MOD_POWER_COST_SCHOOL); - for (Unit::AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i) + if (power->PowerType != POWER_HEALTH) { - if (!((*i)->GetMiscValue() & schoolMask)) - continue; + // Flat mod from caster auras by spell school and power type + Unit::AuraEffectList const& auras = caster->GetAuraEffectsByType(SPELL_AURA_MOD_POWER_COST_SCHOOL); + for (Unit::AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i) + { + if (!((*i)->GetMiscValue() & schoolMask)) + continue; - if (!((*i)->GetMiscValueB() & (1 << power->PowerType))) - continue; + if (!((*i)->GetMiscValueB() & (1 << power->PowerType))) + continue; - powerCost += (*i)->GetAmount(); + powerCost += (*i)->GetAmount(); + } } // Shiv - costs 20 + weaponSpeed*10 energy (apply only to non-triggered spell with energy cost) -- cgit v1.2.3