Play sound at eater, add random pitch

此提交包含在:
Wuzzy
2019-09-24 18:20:12 +02:00
父節點 ebf40debc6
當前提交 91d6d3de5d

查看文件

@@ -79,7 +79,13 @@ function hbhunger.item_eat(hunger_change, replace_with_item, poisen, heal, sound
if h == nil or hp == nil then
return
end
minetest.sound_play({name = sound or "hbhunger_eat_generic", gain = 1}, {pos=user:getpos(), max_hear_distance = 16})
minetest.sound_play(
{name = sound or "hbhunger_eat_generic",
gain = 1},
{object=user,
max_hear_distance = 16,
pitch = 1 + math.random(-10, 10)*0.005,}
)
-- Saturation
if h < 30 and hunger_change then