aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZedron <world_of_warcraft@ymail.com>2015-10-28 16:57:52 -0500
committerZedron <world_of_warcraft@ymail.com>2015-10-28 16:57:52 -0500
commitbd04a460116ccea177339ad06ff7de068cfa1b4b (patch)
treeb3d061e7c3b4614a76ae0d9a635e954c5a37ba17 /src
parentbd16520ecc91d827abae7f0447cc292fe9e843e9 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/SpellInfo.cpp3
1 files changed, 2 insertions, 1 deletions
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::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;
}