Randomize mob pitch sound a bit

This commit is contained in:
Wuzzy 2019-09-22 13:37:00 +02:00
parent 2fc66c0eef
commit 248521b297
1 changed files with 7 additions and 2 deletions

View File

@ -48,8 +48,13 @@ end
local function mob_sound(self, sound, keep_pitch)
local pitch
if self.child and not keep_pitch then
pitch = 1.5
if not keep_pitch then
if self.child then
pitch = 1.5
else
pitch = 1.0
end
pitch = pitch + 0.0025 * math.random(-10,10)
end
minetest.sound_play(
sound,