From e37411dc1308f48860eddaf233bb6f9d09e5b155 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 9 Mar 2019 00:10:59 +0100 Subject: [PATCH] Random pitch for eat/drink sounds --- mods/ITEMS/mcl_buckets/init.lua | 4 ++-- mods/PLAYER/mcl_hunger/hunger.lua | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_buckets/init.lua b/mods/ITEMS/mcl_buckets/init.lua index 3144bd81..e17a9863 100644 --- a/mods/ITEMS/mcl_buckets/init.lua +++ b/mods/ITEMS/mcl_buckets/init.lua @@ -28,14 +28,14 @@ mcl_buckets.liquids = {} local sound_place = function(itemname, pos) local def = minetest.registered_nodes[itemname] if def and def.sounds and def.sounds.place then - minetest.sound_play(def.sounds.place, {gain=1.0, pos = pos}) + minetest.sound_play(def.sounds.place, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005}) end end local sound_take = function(itemname, pos) local def = minetest.registered_nodes[itemname] if def and def.sounds and def.sounds.dug then - minetest.sound_play(def.sounds.dug, {gain=1.0, pos = pos}) + minetest.sound_play(def.sounds.dug, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005}) end end diff --git a/mods/PLAYER/mcl_hunger/hunger.lua b/mods/PLAYER/mcl_hunger/hunger.lua index 81f37e71..7d7306bd 100644 --- a/mods/PLAYER/mcl_hunger/hunger.lua +++ b/mods/PLAYER/mcl_hunger/hunger.lua @@ -148,6 +148,7 @@ function mcl_hunger.item_eat(hunger_change, replace_with_item, poisontime, poiso pos = pos, max_hear_distance = 12, gain = 1.0, + pitch = 1 + math.random(-10, 10)*0.005, }) else -- Assume the item is a food @@ -186,6 +187,7 @@ function mcl_hunger.item_eat(hunger_change, replace_with_item, poisontime, poiso pos = pos, max_hear_distance = 12, gain = 1.0, + pitch = 1 + math.random(-10, 10)*0.005, }) end