From bd04a460116ccea177339ad06ff7de068cfa1b4b Mon Sep 17 00:00:00 2001 From: Zedron Date: Wed, 28 Oct 2015 16:57:52 -0500 Subject: 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 --- src/server/game/Spells/SpellInfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 309b737399e..e91dadca57e 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -2729,7 +2729,8 @@ std::vector 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; } -- cgit v1.2.3