Fixed bug when eating pie while using stamina mod
This commit is contained in:
parent
0478f2eba4
commit
39878eb77f
9
init.lua
9
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user