Skip to content
Snippets Groups Projects
Commit 841bc70b authored by Jeija's avatar Jeija
Browse files

Fix a bug that occured when using a receptor placed directly next to a

gate.
We need to call a changesignal even if the gate/other effector is still
connected to a power source in a way.
parent 17579a6a
No related branches found
No related tags found
No related merge requests found
......@@ -94,8 +94,12 @@ function mesecon:receptor_off(pos, rules)
for _, rule in ipairs(rules) do
local np = mesecon:addPosRule(pos, rule)
local link, rulename = mesecon:rules_link(pos, np, rules)
if link and not mesecon:connected_to_receptor(np) then
mesecon:turnoff(np, rulename)
if link then
if not mesecon:connected_to_receptor(np) then
mesecon:turnoff(np, rulename)
else
mesecon:changesignal(np, minetest.env:get_node(np), rulename)
end
end
end
end
......
......@@ -99,7 +99,7 @@ gates = {
{name = "xor" , inputnumber = 2}}
local onoff, drop, nodename, description, groups
for i, gate in ipairs(gates) do
for _, gate in ipairs(gates) do
if gate.inputnumber == 1 then
get_rules = gate_get_input_rules_oneinput
elseif gate.inputnumber == 2 then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment