Noteblock: Fade out fire sound (#527)

This commit is contained in:
Wuzzy 2020-09-17 19:30:03 +02:00 committed by GitHub
parent 9fda51b650
commit fedbf49372
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,5 +81,11 @@ mesecon.noteblock_play = function(pos, param2)
end
end
pos.y = pos.y+1
if soundname == "fire_fire" then
-- Smoothly fade out fire sound
local handle = minetest.sound_play(soundname, {pos = pos, loop = true})
minetest.after(3.0, minetest.sound_fade, handle, -1.5, 0.0)
else
minetest.sound_play(soundname, {pos = pos}, true)
end
end