Wireless doesn't work if channel is empty.

This commit is contained in:
paly2 2016-04-27 14:04:39 +02:00
parent 2a30ceaa1b
commit e4ed8a50ee

View File

@ -24,7 +24,12 @@ local function wireless_activate(pos)
-- jamming doesn't disallow receiving signals, only sending them -- jamming doesn't disallow receiving signals, only sending them
return return
end end
local channel_first_wireless = minetest.get_meta(pos):get_string("channel") local channel_first_wireless = minetest.get_meta(pos):get_string("channel")
if channel_first_wireless == "" then
return
end
for i = 1, #wireless do for i = 1, #wireless do
if not vector.equals(wireless[i], pos) if not vector.equals(wireless[i], pos)
and minetest.get_meta(wireless[i]):get_string("channel") == channel_first_wireless then and minetest.get_meta(wireless[i]):get_string("channel") == channel_first_wireless then
@ -48,7 +53,7 @@ end
local function on_digiline_receive(pos, node, channel, msg) local function on_digiline_receive(pos, node, channel, msg)
local setchan = minetest.get_meta(pos):get_string("channel") -- Note : the digiline channel is the same as the wireless channel. TODO: Making two different channels and a more complex formspec ? local setchan = minetest.get_meta(pos):get_string("channel") -- Note : the digiline channel is the same as the wireless channel. TODO: Making two different channels and a more complex formspec ?
if channel ~= setchan or is_jammed(pos) then if channel ~= setchan or is_jammed(pos) or setchan == "" then
return return
end end
for i = 1, #wireless do for i = 1, #wireless do