mirror of
git://repo.or.cz/minetest_hbhunger.git
synced 2024-11-13 05:40:35 +01:00
Fixed custom sound
This commit is contained in:
parent
ba6bfffc9d
commit
3763748e89
|
@ -70,13 +70,13 @@ local function poisenp(tick, time, time_left, player)
|
|||
|
||||
end
|
||||
|
||||
function hbhunger.item_eat(hunger_change, replace_with_item, poisen, heal)
|
||||
function hbhunger.item_eat(hunger_change, replace_with_item, poisen, heal, sound)
|
||||
return function(itemstack, user, pointed_thing)
|
||||
if itemstack:take_item() ~= nil and user ~= nil then
|
||||
local name = user:get_player_name()
|
||||
local h = tonumber(hbhunger.hunger[name])
|
||||
local hp = user:get_hp()
|
||||
minetest.sound_play({name = "hbhunger_eat_generic", gain = 1}, {pos=user:getpos(), max_hear_distance = 16})
|
||||
minetest.sound_play({name = sound or "hbhunger_eat_generic", gain = 1}, {pos=user:getpos(), max_hear_distance = 16})
|
||||
|
||||
-- Saturation
|
||||
if h < 30 and hunger_change then
|
||||
|
|
Loading…
Reference in New Issue
Block a user