Edit cake to support hud

They will now fill your hunder instead of heal.
This commit is contained in:
Elkien3 2017-09-23 21:34:40 -05:00
parent c43756067f
commit e48f5b9681

View File

@ -47,8 +47,12 @@ for i, size in ipairs(sizes) do
} }
}, },
on_rightclick = function(pos, node, clicker) on_rightclick = function(pos, node, clicker)
clicker:set_hp(clicker:get_hp() + 1) -- clicker:set_hp(clicker:get_hp() + 1)
local name = clicker:get_player_name()
local h = tonumber(hud.hunger[name])
h = h + 4
hud.hunger[name] = h
hud.set_hunger(clicker)
if i < #sizes then if i < #sizes then
minetest.swap_node(pos, {name="cake:cake_"..i}) minetest.swap_node(pos, {name="cake:cake_"..i})
else else