summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2015-02-23 23:49:55 +0100
committerWuzzy <almikes@aol.com>2015-02-23 23:49:55 +0100
commitbfdabd4badd509090a1cc2bffac5f64b283ba0b3 (patch)
tree0f1a8ea194684a4b393630a2d1fa7a0183a3891e /init.lua
parente52921ba97bf7bc28b8551c2ad9b9c0fc3f38e74 (diff)
Fix number-related mistakes
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/init.lua b/init.lua
index 4389411..96d3194 100644
--- a/init.lua
+++ b/init.lua
@@ -29,14 +29,14 @@ end
local function custom_hud(player)
if minetest.setting_getbool("enable_damage") then
--hunger
- hb.init_hudbar(player, "saturation")
+ hb.init_hudbar(player, "saturation", hunger.get_hunger(player))
end
end
dofile(minetest.get_modpath("hunger").."/hunger.lua")
-- register saturation hudbar
-hb.register_hudbar("saturation", 0xFFFFFF, "Saturation", { icon = "hunger_icon.png", bar = "hunger_bar.png" }, 20, 20, false)
+hb.register_hudbar("saturation", 0xFFFFFF, "Saturation", { icon = "hunger_icon.png", bar = "hunger_bar.png" }, 20, 30, false)
-- update hud elemtens if value has changed
local function update_hud(player)
@@ -46,8 +46,6 @@ local function update_hud(player)
local h = tonumber(hunger.hunger[name])
if h_out ~= h then
hunger.hunger_out[name] = h
- -- bar should not have more than 10 icons
- if h>20 then h=20 end
hb.change_hudbar(player, "saturation", h)
end
end