From 39878eb77fd31786cc2eb55b9c02f2b77a4a69e5 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Mon, 18 Jul 2016 11:50:49 +0100 Subject: [PATCH] Fixed bug when eating pie while using stamina mod --- init.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index f273ffb..2953e48 100644 --- a/init.lua +++ b/init.lua @@ -24,17 +24,18 @@ local replace_pie = function(node, puncher, pos) h = math.min(h + 4, 30) local ok = hunger.update_hunger(puncher, h) minetest.sound_play("hunger_eat", { - pos = pos, gain = 0.7, hear_distance = 5}) + pos = pos, gain = 0.7, max_hear_distance = 5}) elseif hbmod then local h = tonumber(hbhunger.hunger[puncher:get_player_name()]) --print ("hbhunger is "..h) h = math.min(h + 4, 30) hbhunger.hunger[puncher:get_player_name()] = h minetest.sound_play("hbhunger_eat_generic", { - pos = pos, gain = 0.7, hear_distance = 5}) + pos = pos, gain = 0.7, max_hear_distance = 5}) elseif stmod then - stamina.amend_level(puncher, 4) - minetest.sound_play("stamina_eat", {to_player = name, gain = 0.7}) + stamina.change(puncher, 4) + minetest.sound_play("stamina_eat", { + to_player = name, gain = 0.7, max_hear_distance = 5}) else local h = puncher:get_hp() --print ("health is "..h)