mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-12-26 10:20:19 +01:00
Fix bug introduced in previous commit that broke all logic blocks
turnon / turnoff were calling activate / deactivate on nodes even though their rules didn't link Fixes #278, thanks to @darkfeels
This commit is contained in:
parent
7c7595fd7d
commit
778ee427f4
@ -408,9 +408,12 @@ function mesecon.turnon(pos, link)
|
|||||||
minetest.swap_node(f.pos, {name = mesecon.get_conductor_on(node, f.link),
|
minetest.swap_node(f.pos, {name = mesecon.get_conductor_on(node, f.link),
|
||||||
param2 = node.param2})
|
param2 = node.param2})
|
||||||
|
|
||||||
for npos, l in pairs(neighborlinks) do
|
for npos, links in pairs(neighborlinks) do
|
||||||
|
-- links = all links to node, l = each single link
|
||||||
|
for _, l in ipairs(links) do
|
||||||
table.insert(frontiers, {pos = minetest.get_position_from_hash(npos), link = l})
|
table.insert(frontiers, {pos = minetest.get_position_from_hash(npos), link = l})
|
||||||
end
|
end
|
||||||
|
end
|
||||||
else
|
else
|
||||||
mesecon.queue:add_action(f.pos, "turnon", {f.link}, nil, true)
|
mesecon.queue:add_action(f.pos, "turnon", {f.link}, nil, true)
|
||||||
end
|
end
|
||||||
@ -465,9 +468,12 @@ function mesecon.turnoff(pos, link)
|
|||||||
minetest.swap_node(f.pos, {name = mesecon.get_conductor_off(node, f.link),
|
minetest.swap_node(f.pos, {name = mesecon.get_conductor_off(node, f.link),
|
||||||
param2 = node.param2})
|
param2 = node.param2})
|
||||||
|
|
||||||
for npos, l in pairs(neighborlinks) do
|
for npos, links in pairs(neighborlinks) do
|
||||||
|
-- links = all links to node, l = each single link
|
||||||
|
for _, l in ipairs(links) do
|
||||||
table.insert(frontiers, {pos = minetest.get_position_from_hash(npos), link = l})
|
table.insert(frontiers, {pos = minetest.get_position_from_hash(npos), link = l})
|
||||||
end
|
end
|
||||||
|
end
|
||||||
else
|
else
|
||||||
mesecon.queue:add_action(f.pos, "turnoff", {f.link}, nil, true)
|
mesecon.queue:add_action(f.pos, "turnoff", {f.link}, nil, true)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user