Core/Spells: Fixed a mistake in SpellInfo::CalcPowerCost

Fixed a mistake which caused some SPELLMOD_COST modifiers to give (lots) of power instead of taking power in Spell::TakePower
This commit is contained in:
Zedron
2015-10-28 16:57:52 -05:00
parent bd16520ecc
commit bd04a46011

View File

@@ -2729,7 +2729,8 @@ std::vector<SpellInfo::CostData> SpellInfo::CalcPowerCost(Unit const* caster, Sp
else
collector(sDB2Manager.GetSpellPowers(Id, caster->GetMap()->GetDifficultyID()));
std::remove_if(costs.begin(), costs.end(), [](CostData const& cost) { return cost.Amount <= 0; });
// POWER_RUNES is handled by SpellRuneCost.db2, and cost.Amount is always 0 (see Spell::TakeRunePower)
costs.erase(std::remove_if(costs.begin(), costs.end(), [](CostData const& cost) { return cost.Power != POWER_RUNES && cost.Amount <= 0; }), costs.end());
return costs;
}