diff options
| author | Shauren <shauren.trinity@gmail.com> | 2017-01-17 20:14:44 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2017-01-17 20:14:44 +0100 |
| commit | 6767bbc95f46df4b62c8131a39a132d3f9bb8a26 (patch) | |
| tree | e8129b118ec3ae7a3be2afc00dfdd01752e8ecff /src/server/game/Spells/SpellInfo.cpp | |
| parent | bc0d82a81e12e802154cdad0833c187de80b3865 (diff) | |
Fix static analysis issues
CID 1291964
CID 1292775
Diffstat (limited to 'src/server/game/Spells/SpellInfo.cpp')
| -rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
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::CostData> 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) |
