From 98b281aadec036383e4c0c57610b1ccea938691f Mon Sep 17 00:00:00 2001 From: Louis Royer <4259825-lroyer@users.noreply.gitlab.com> Date: Wed, 5 Aug 2020 16:10:33 +0200 Subject: [PATCH] Fix minetest warnings from homedecor_lighting ``` Undeclared global variable "mesecon" accessed at ...etest/mods/homedecor_modpack/homedecor_lighting/init.lua:852 Undeclared global variable "mesecon" accessed at ...etest/mods/homedecor_modpack/homedecor_lighting/init.lua:898 ``` --- homedecor_lighting/init.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homedecor_lighting/init.lua b/homedecor_lighting/init.lua index c86ccb6a..90e02b2b 100644 --- a/homedecor_lighting/init.lua +++ b/homedecor_lighting/init.lua @@ -847,14 +847,14 @@ for _, light_brightn_name in ipairs({"off", "on"}) do } }, on_rightclick = on_rc, - mesecons = { + mesecons = hd_mesecons and { conductor = { state = mesecon and (onflag and mesecon.state.on or mesecon.state.off), onstate = "homedecor:rope_light_on_floor_on", offstate = "homedecor:rope_light_on_floor_off", rules = rules_alldir }, - } + } or nil, }) minetest.register_node(":homedecor:rope_light_on_ceiling_"..light_brightn_name, { @@ -893,14 +893,14 @@ for _, light_brightn_name in ipairs({"off", "on"}) do } }, on_rightclick = on_rc, - mesecons = { + mesecons = hd_mesecons and { conductor = { state = mesecon and (onflag and mesecon.state.on or mesecon.state.off), onstate = "homedecor:rope_light_on_ceiling_on", offstate = "homedecor:rope_light_on_ceiling_off", rules = rules_alldir }, - } + } or nil, }) homedecor.register("wall_lamp_"..light_brightn_name, {