mirror of
https://repo.or.cz/minetest_hudbars.git
synced 2024-08-20 05:04:12 +02:00
Add workaround for bad initial breath value
This commit is contained in:
parent
05b9c3b882
commit
4ebc24f2ed
6
init.lua
6
init.lua
@ -293,13 +293,13 @@ end
|
||||
local function update_hud(player)
|
||||
if minetest.setting_getbool("enable_damage") then
|
||||
--air
|
||||
local air = player:get_breath()
|
||||
local breath = player:get_breath()
|
||||
|
||||
if air == 11 then
|
||||
if breath == 11 then
|
||||
hb.hide_hudbar(player, "breath")
|
||||
else
|
||||
hb.unhide_hudbar(player, "breath")
|
||||
hb.change_hudbar(player, "breath", air)
|
||||
hb.change_hudbar(player, "breath", math.min(breath, 10))
|
||||
end
|
||||
|
||||
--health
|
||||
|
Loading…
Reference in New Issue
Block a user