mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-12-25 01:40:18 +01:00
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.
This commit is contained in:
parent
17579a6aa1
commit
841bc70b97
@ -94,8 +94,12 @@ function mesecon:receptor_off(pos, rules)
|
|||||||
for _, rule in ipairs(rules) do
|
for _, rule in ipairs(rules) do
|
||||||
local np = mesecon:addPosRule(pos, rule)
|
local np = mesecon:addPosRule(pos, rule)
|
||||||
local link, rulename = mesecon:rules_link(pos, np, rules)
|
local link, rulename = mesecon:rules_link(pos, np, rules)
|
||||||
if link and not mesecon:connected_to_receptor(np) then
|
if link then
|
||||||
mesecon:turnoff(np, rulename)
|
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
|
end
|
||||||
end
|
end
|
||||||
|
@ -99,7 +99,7 @@ gates = {
|
|||||||
{name = "xor" , inputnumber = 2}}
|
{name = "xor" , inputnumber = 2}}
|
||||||
|
|
||||||
local onoff, drop, nodename, description, groups
|
local onoff, drop, nodename, description, groups
|
||||||
for i, gate in ipairs(gates) do
|
for _, gate in ipairs(gates) do
|
||||||
if gate.inputnumber == 1 then
|
if gate.inputnumber == 1 then
|
||||||
get_rules = gate_get_input_rules_oneinput
|
get_rules = gate_get_input_rules_oneinput
|
||||||
elseif gate.inputnumber == 2 then
|
elseif gate.inputnumber == 2 then
|
||||||
|
Loading…
Reference in New Issue
Block a user