Use VM transactions for conductor state changes.

VoxelManipulator-based transactions are used to hopefully speed up
scanning and replacing of networks of conductors when receptors start or
stop driving signals into them.
This commit is contained in:
Christopher Head
2016-08-20 21:54:15 -07:00
parent 6d79272ed4
commit bc9d4c2d5a
2 changed files with 10 additions and 4 deletions

View File

@ -405,8 +405,7 @@ function mesecon.turnon(pos, link)
end
if success then
minetest.swap_node(f.pos, {name = mesecon.get_conductor_on(node, f.link),
param2 = node.param2})
mesecon.swap_node_force(f.pos, mesecon.get_conductor_on(node, f.link))
for npos, links in pairs(neighborlinks) do
-- links = all links to node, l = each single link
@ -465,8 +464,7 @@ function mesecon.turnoff(pos, link)
end
if success then
minetest.swap_node(f.pos, {name = mesecon.get_conductor_off(node, f.link),
param2 = node.param2})
mesecon.swap_node_force(f.pos, mesecon.get_conductor_off(node, f.link))
for npos, links in pairs(neighborlinks) do
-- links = all links to node, l = each single link