mirror of
https://repo.or.cz/minetest_hudbars.git
synced 2024-11-27 17:43:44 +01: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)
|
local function update_hud(player)
|
||||||
if minetest.setting_getbool("enable_damage") then
|
if minetest.setting_getbool("enable_damage") then
|
||||||
--air
|
--air
|
||||||
local air = player:get_breath()
|
local breath = player:get_breath()
|
||||||
|
|
||||||
if air == 11 then
|
if breath == 11 then
|
||||||
hb.hide_hudbar(player, "breath")
|
hb.hide_hudbar(player, "breath")
|
||||||
else
|
else
|
||||||
hb.unhide_hudbar(player, "breath")
|
hb.unhide_hudbar(player, "breath")
|
||||||
hb.change_hudbar(player, "breath", air)
|
hb.change_hudbar(player, "breath", math.min(breath, 10))
|
||||||
end
|
end
|
||||||
|
|
||||||
--health
|
--health
|
||||||
|
Loading…
Reference in New Issue
Block a user