From 1a4ec509392ac3572737676b7ac55d4cea9ec10e Mon Sep 17 00:00:00 2001 From: kay27 Date: Mon, 21 Feb 2022 05:51:00 +0400 Subject: [PATCH] #220 Fix a crash in mcl_comparators --- mods/ITEMS/REDSTONE/mcl_comparators/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/REDSTONE/mcl_comparators/init.lua b/mods/ITEMS/REDSTONE/mcl_comparators/init.lua index 3517e09cb..b596f26ff 100644 --- a/mods/ITEMS/REDSTONE/mcl_comparators/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_comparators/init.lua @@ -43,7 +43,9 @@ end local function comparator_activate(pos, node) local def = minetest.registered_nodes[node.name] - minetest.swap_node(pos, { name = def.comparator_onstate, param2 = node.param2 }) + local on_state = def.comparator_onstate + if not on_state then return end + minetest.swap_node(pos, { name = on_state, param2 = node.param2 }) minetest.after(0.1, comparator_turnon , {pos = pos, node = node}) end