1
0
mirror of git://repo.or.cz/minetest_hbhunger.git synced 2024-11-16 15:20:34 +01:00

Play sound at eater, add random pitch

This commit is contained in:
Wuzzy 2019-09-24 18:20:12 +02:00
parent ebf40debc6
commit 91d6d3de5d

View File

@ -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