Core/Players: Fixed last tick of power regeneration when reaching minimum or maximum value not being visible clientside and not triggering auras on power value change

Port From (https://github.com/TrinityCore/TrinityCore/commit/5158136ee8a77046e37bafa192481b8b61d4a116)
This commit is contained in:
hondacrx
2021-05-17 14:39:37 -04:00
parent 45df8db19e
commit 891c3b6478
+4 -1
View File
@@ -3772,6 +3772,7 @@ namespace Game.Entities
addvalue += m_powerFraction[powerIndex];
int integerValue = (int)Math.Abs(addvalue);
bool forcesSetPower = false;
if (addvalue < 0.0f)
{
if (curValue <= minPower)
@@ -3796,6 +3797,7 @@ namespace Game.Entities
{
curValue = minPower;
m_powerFraction[powerIndex] = 0;
forcesSetPower = true;
}
}
else
@@ -3809,13 +3811,14 @@ namespace Game.Entities
{
curValue = maxPower;
m_powerFraction[powerIndex] = 0;
forcesSetPower = true;
}
}
if (GetCommandStatus(PlayerCommandStates.Power))
curValue = maxPower;
if (m_regenTimerCount >= 2000)
if (m_regenTimerCount >= 2000 || forcesSetPower)
SetPower(power, curValue);
else
{