From 127fabfb67fd83ffe05c7b183bff6ce5425b4cc7 Mon Sep 17 00:00:00 2001 From: Henry Behrendt Date: Mon, 13 Sep 2021 21:08:22 +0200 Subject: [PATCH] fix issue #1 --- mcl_comparators/init.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mcl_comparators/init.lua b/mcl_comparators/init.lua index 9d48ffb..ed15a8e 100644 --- a/mcl_comparators/init.lua +++ b/mcl_comparators/init.lua @@ -221,8 +221,11 @@ local function comparator_desired_on(pos, node) local side_voltage = 0 for ri = 2,3 do if my_input_rules[ri] then - local _, s_voltage = mesecon.is_power_on(vector.add(pos, my_input_rules[ri])) - side_voltage = math.max(side_voltage, s_voltage) + for _, l in pairs(mesecon.rules_link_rule_all_inverted(pos, my_input_rules[ri])) do + local _, s_voltage = mesecon.is_power_on(vector.add(pos, my_input_rules[ri])) + side_voltage = math.max(side_voltage, s_voltage) + end + end end if mode == "comp" then