Fix error message when reducing max. player hp

pull/5/head
Wuzzy 2023-03-09 12:52:18 +01:00
parent dd2a9a008d
commit 4876bbbb00
1 changed files with 2 additions and 1 deletions

View File

@ -500,7 +500,8 @@ end
local function update_health(player)
local hp_max = player:get_properties().hp_max
hb.change_hudbar(player, "health", player:get_hp(), hp_max)
local hp = math.min(player:get_hp(), hp_max)
hb.change_hudbar(player, "health", hp, hp_max)
end
-- update built-in HUD bars