Core/Players: Fixed regenerating powers with CenterPower regen
Port From (https://github.com/TrinityCore/TrinityCore/commit/7885bdf8afc37e5594128acf42e06d3f8bc3f669)
This commit is contained in:
@@ -3753,22 +3753,6 @@ namespace Game.Entities
|
|||||||
int minPower = powerType.MinPower;
|
int minPower = powerType.MinPower;
|
||||||
int maxPower = GetMaxPower(power);
|
int maxPower = GetMaxPower(power);
|
||||||
|
|
||||||
if (addvalue < 0.0f)
|
|
||||||
{
|
|
||||||
if (curValue <= minPower)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if (addvalue > 0.0f)
|
|
||||||
{
|
|
||||||
if (curValue >= maxPower)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
|
|
||||||
addvalue += m_powerFraction[powerIndex];
|
|
||||||
int integerValue = (int)Math.Abs(addvalue);
|
|
||||||
|
|
||||||
if (powerType.CenterPower != 0)
|
if (powerType.CenterPower != 0)
|
||||||
{
|
{
|
||||||
if (curValue > powerType.CenterPower)
|
if (curValue > powerType.CenterPower)
|
||||||
@@ -3785,6 +3769,22 @@ namespace Game.Entities
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addvalue += m_powerFraction[powerIndex];
|
||||||
|
int integerValue = (int)Math.Abs(addvalue);
|
||||||
|
|
||||||
|
if (addvalue < 0.0f)
|
||||||
|
{
|
||||||
|
if (curValue <= minPower)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (addvalue > 0.0f)
|
||||||
|
{
|
||||||
|
if (curValue >= maxPower)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
if (addvalue < 0.0f)
|
if (addvalue < 0.0f)
|
||||||
{
|
{
|
||||||
if (curValue > minPower + integerValue)
|
if (curValue > minPower + integerValue)
|
||||||
|
|||||||
Reference in New Issue
Block a user