forked from Mirrorlandia_minetest/digistuff
Fix noteblocks responding to get_sounds on every channel
This commit is contained in:
parent
97765470fc
commit
f6890e5ed0
@ -35,16 +35,17 @@ minetest.register_node("digistuff:noteblock", {
|
|||||||
receptor = {},
|
receptor = {},
|
||||||
effector = {
|
effector = {
|
||||||
action = function(pos,node,channel,msg)
|
action = function(pos,node,channel,msg)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
local setchan = meta:get_string("channel")
|
||||||
|
if channel ~= setchan then return end
|
||||||
if msg == "get_sounds" then
|
if msg == "get_sounds" then
|
||||||
local soundnames = {}
|
local soundnames = {}
|
||||||
for i in pairs(validnbsounds) do
|
for i in pairs(validnbsounds) do
|
||||||
table.insert(soundnames,i)
|
table.insert(soundnames,i)
|
||||||
end
|
end
|
||||||
digiline:receptor_send(pos, digiline.rules.default, channel, soundnames)
|
digiline:receptor_send(pos, digiline.rules.default, channel, soundnames)
|
||||||
|
return
|
||||||
end
|
end
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
local setchan = meta:get_string("channel")
|
|
||||||
if channel ~= setchan then return end
|
|
||||||
if type(msg) == "string" then
|
if type(msg) == "string" then
|
||||||
local sound = validnbsounds[msg]
|
local sound = validnbsounds[msg]
|
||||||
if sound then minetest.sound_play(sound,{pos=pos}) end
|
if sound then minetest.sound_play(sound,{pos=pos}) end
|
||||||
|
Loading…
Reference in New Issue
Block a user