deaktivate wire/effector on dig receptor
This commit is contained in:
parent
7ab1246902
commit
b537c40411
|
@ -95,12 +95,11 @@ function mesecon.receptor_on(pos, rules, voltage, opaquespread)
|
||||||
mesecon.queue:add_action(pos, "receptor_on", {rules, voltage, opaquespread}, nil, rules)
|
mesecon.queue:add_action(pos, "receptor_on", {rules, voltage, opaquespread}, nil, rules)
|
||||||
end
|
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
|
rules = rules or mesecon.rules.default
|
||||||
|
|
||||||
local node = mesecon.get_node_force(pos)
|
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
|
-- Call turnoff on all linking positions
|
||||||
for _, rule in ipairs(mesecon.flattenrules(rules)) do
|
for _, rule in ipairs(mesecon.flattenrules(rules)) do
|
||||||
local np = vector.add(pos, rule)
|
local np = vector.add(pos, rule)
|
||||||
|
@ -131,8 +130,8 @@ mesecon.queue:add_function("receptor_off", function (pos, rules)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
function mesecon.receptor_off(pos, rules)
|
function mesecon.receptor_off(pos, rules, opaquespread)
|
||||||
mesecon.queue:add_action(pos, "receptor_off", {rules}, nil, rules)
|
mesecon.queue:add_action(pos, "receptor_off", {rules, opaquespread}, nil, rules)
|
||||||
end
|
end
|
||||||
|
|
||||||
--Services like turnoff receptor on dignode and so on
|
--Services like turnoff receptor on dignode and so on
|
||||||
|
|
Loading…
Reference in New Issue