Fix error message when reducing max. player hp
parent
dd2a9a008d
commit
4876bbbb00
3
init.lua
3
init.lua
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue