Check that the received message is a string before doing anything with it
parent
864e158d3c
commit
56466a704e
5
init.lua
5
init.lua
|
@ -32,10 +32,9 @@ end
|
|||
|
||||
local function multicolour_light_effector_action(pos, node, channel, msg)
|
||||
local configured_channel = minetest.get_meta(pos):get_string("digich")
|
||||
if channel == configured_channel then
|
||||
-- quick test
|
||||
if channel == configured_channel and type(msg) == "string" then
|
||||
local node = minetest.get_node(pos)
|
||||
local onoff,colour = msg:match("^([^#]+)#?(%x-)$")
|
||||
local onoff, colour = msg:match("^([^#]+)#?(%x-)$")
|
||||
if onoff == "off" and node.name == "digiplay:multicolour_light_on" then
|
||||
node.name = "digiplay:multicolour_light"
|
||||
elseif onoff == "on" and node.name == "digiplay:multicolour_light" then
|
||||
|
|
Loading…
Reference in New Issue