Core/Spells: Prevent spell power costs from changing their sign (positive cost cannot become negative)

Port From (https://github.com/TrinityCore/TrinityCore/commit/01a3be276f4076762290e985d10d5c4ab1176ce0)
This commit is contained in:
hondacrx
2021-02-22 16:07:10 -05:00
parent f25af46c8f
commit d1c0aa114a
+5
View File
@@ -2714,6 +2714,7 @@ namespace Game.Spells
// Base powerCost
int powerCost = power.ManaCost;
bool initiallyNegative = powerCost < 0;
// PCT cost from total amount
if (power.PowerCostPct != 0)
{
@@ -2847,6 +2848,10 @@ namespace Game.Spells
continue;
}
// power cost cannot become negative if initially positive
if (initiallyNegative != (powerCost < 0))
powerCost = 0;
bool found = false;
for (var i = 0; i < costs.Count; ++i)
{