summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2015-02-12 22:15:19 +0100
committerWuzzy <almikes@aol.com>2015-02-12 22:15:19 +0100
commit4ebc24f2ed591a617f2d95536c66e9e3c9d765a4 (patch)
tree947ac9b0062ff7d4bf8635d223ac82465f66aa1d
parent05b9c3b8823261de286d725f14c6fab0389e9252 (diff)
Add workaround for bad initial breath value
-rw-r--r--init.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index a2dd66f..f42347a 100644
--- a/init.lua
+++ b/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