Convert minetest.sound_play uses to ephemeral

This commit is contained in:
sfan5
2020-01-25 23:45:09 +01:00
parent 176ddba176
commit d3e26dba18
9 changed files with 28 additions and 22 deletions

View File

@ -46,7 +46,8 @@ function default.chest.chest_lid_close(pn)
local node = minetest.get_node(pos)
minetest.after(0.2, minetest.swap_node, pos, { name = "default:" .. swap,
param2 = node.param2 })
minetest.sound_play(sound, {gain = 0.3, pos = pos, max_hear_distance = 10})
minetest.sound_play(sound, {gain = 0.3, pos = pos,
max_hear_distance = 10}, true)
end
default.chest.open_chests = {}
@ -128,7 +129,7 @@ function default.chest.register_chest(name, d)
end
minetest.sound_play(def.sound_open, {gain = 0.3,
pos = pos, max_hear_distance = 10})
pos = pos, max_hear_distance = 10}, true)
if not default.chest.chest_lid_obstructed(pos) then
minetest.swap_node(pos,
{ name = "default:" .. name .. "_open",
@ -199,7 +200,7 @@ function default.chest.register_chest(name, d)
end
def.on_rightclick = function(pos, node, clicker)
minetest.sound_play(def.sound_open, {gain = 0.3, pos = pos,
max_hear_distance = 10})
max_hear_distance = 10}, true)
if not default.chest.chest_lid_obstructed(pos) then
minetest.swap_node(pos, {
name = "default:" .. name .. "_open",