mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 18:40:28 +00:00
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,14 +2507,17 @@ void Player::GiveLevel(uint8 level)
|
||||
|
||||
_ApplyAllLevelScaleItemMods(true);
|
||||
|
||||
// set current level health and mana/energy to maximum after applying all mods.
|
||||
SetFullHealth();
|
||||
SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
|
||||
SetPower(POWER_ENERGY, GetMaxPower(POWER_ENERGY));
|
||||
if (GetPower(POWER_RAGE) > GetMaxPower(POWER_RAGE))
|
||||
SetPower(POWER_RAGE, GetMaxPower(POWER_RAGE));
|
||||
SetPower(POWER_FOCUS, 0);
|
||||
SetPower(POWER_HAPPINESS, 0);
|
||||
if (!isDead())
|
||||
{
|
||||
// set current level health and mana/energy to maximum after applying all mods.
|
||||
SetFullHealth();
|
||||
SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
|
||||
SetPower(POWER_ENERGY, GetMaxPower(POWER_ENERGY));
|
||||
if (GetPower(POWER_RAGE) > GetMaxPower(POWER_RAGE))
|
||||
SetPower(POWER_RAGE, GetMaxPower(POWER_RAGE));
|
||||
SetPower(POWER_FOCUS, 0);
|
||||
SetPower(POWER_HAPPINESS, 0);
|
||||
}
|
||||
|
||||
// update level to hunter/summon pet
|
||||
if (Pet* pet = GetPet())
|
||||
|
||||
Reference in New Issue
Block a user