mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 02:46:33 +01:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user