Fix crash in parsing colours
parent
3fd00c30ec
commit
42723886ae
4
init.lua
4
init.lua
|
@ -54,13 +54,13 @@ local function multicolour_light_effector_action(pos, node, channel, msg)
|
|||
local configured_channel = minetest.get_meta(pos):get_string("digich")
|
||||
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
|
||||
node.name = "digiplay:multicolour_light_on"
|
||||
end
|
||||
if colour ~= "" then
|
||||
if colour ~= "" and colour ~= nil then
|
||||
local base
|
||||
if colour:match("^%x%x%x%x%x%x$") then
|
||||
base = 256
|
||||
|
|
Loading…
Reference in New Issue