fix(Core/Players): don't set full heath/mana/rage while Dead (#20723)
fix level up while dead -> check if player is not dead, then update health/mana/rage/.. Co-authored-by: gontrannopier <gontrannopier@gontrannopier.com>
This commit is contained in:
@@ -2507,6 +2507,8 @@ void Player::GiveLevel(uint8 level)
|
|||||||
|
|
||||||
_ApplyAllLevelScaleItemMods(true);
|
_ApplyAllLevelScaleItemMods(true);
|
||||||
|
|
||||||
|
if (!isDead())
|
||||||
|
{
|
||||||
// set current level health and mana/energy to maximum after applying all mods.
|
// set current level health and mana/energy to maximum after applying all mods.
|
||||||
SetFullHealth();
|
SetFullHealth();
|
||||||
SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
|
SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
|
||||||
@@ -2515,6 +2517,7 @@ void Player::GiveLevel(uint8 level)
|
|||||||
SetPower(POWER_RAGE, GetMaxPower(POWER_RAGE));
|
SetPower(POWER_RAGE, GetMaxPower(POWER_RAGE));
|
||||||
SetPower(POWER_FOCUS, 0);
|
SetPower(POWER_FOCUS, 0);
|
||||||
SetPower(POWER_HAPPINESS, 0);
|
SetPower(POWER_HAPPINESS, 0);
|
||||||
|
}
|
||||||
|
|
||||||
// update level to hunter/summon pet
|
// update level to hunter/summon pet
|
||||||
if (Pet* pet = GetPet())
|
if (Pet* pet = GetPet())
|
||||||
|
|||||||
Reference in New Issue
Block a user