Skip to content

Commit

Permalink
Fix bug introduced in previous commit that broke all logic blocks
Browse files Browse the repository at this point in the history
turnon / turnoff were calling activate / deactivate on nodes even though
their rules didn't link

Fixes #278, thanks to @darkfeels
  • Loading branch information
Jeija committed Jul 31, 2016
1 parent 7c7595f commit 778ee42
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions mesecons/internal.lua
Expand Up @@ -408,8 +408,11 @@ function mesecon.turnon(pos, link)
minetest.swap_node(f.pos, {name = mesecon.get_conductor_on(node, f.link),
param2 = node.param2})

for npos, l in pairs(neighborlinks) do
table.insert(frontiers, {pos = minetest.get_position_from_hash(npos), link = l})
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})
end
end
else
mesecon.queue:add_action(f.pos, "turnon", {f.link}, nil, true)
Expand Down Expand Up @@ -465,8 +468,11 @@ function mesecon.turnoff(pos, link)
minetest.swap_node(f.pos, {name = mesecon.get_conductor_off(node, f.link),
param2 = node.param2})

for npos, l in pairs(neighborlinks) do
table.insert(frontiers, {pos = minetest.get_position_from_hash(npos), link = l})
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})
end
end
else
mesecon.queue:add_action(f.pos, "turnoff", {f.link}, nil, true)
Expand Down

0 comments on commit 778ee42

Please sign in to comment.