From b537c40411ea057bafddf235954c6c910fa1383c Mon Sep 17 00:00:00 2001 From: Henry Behrendt Date: Sun, 5 Sep 2021 21:03:59 +0200 Subject: [PATCH] deaktivate wire/effector on dig receptor --- mesecons/init.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mesecons/init.lua b/mesecons/init.lua index bf99311..013ac1f 100644 --- a/mesecons/init.lua +++ b/mesecons/init.lua @@ -95,12 +95,11 @@ function mesecon.receptor_on(pos, rules, voltage, opaquespread) mesecon.queue:add_action(pos, "receptor_on", {rules, voltage, opaquespread}, nil, rules) end -mesecon.queue:add_function("receptor_off", function (pos, rules) +mesecon.queue:add_function("receptor_off", function (pos, rules, opaquespread) rules = rules or mesecon.rules.default local node = mesecon.get_node_force(pos) - local os=mesecon.is_receptor_opaquespread(node.name) - + local os=opaquespread or mesecon.is_receptor_opaquespread(node.name) -- Call turnoff on all linking positions for _, rule in ipairs(mesecon.flattenrules(rules)) do local np = vector.add(pos, rule) @@ -131,8 +130,8 @@ mesecon.queue:add_function("receptor_off", function (pos, rules) end end) -function mesecon.receptor_off(pos, rules) - mesecon.queue:add_action(pos, "receptor_off", {rules}, nil, rules) +function mesecon.receptor_off(pos, rules, opaquespread) + mesecon.queue:add_action(pos, "receptor_off", {rules, opaquespread}, nil, rules) end --Services like turnoff receptor on dignode and so on