type = "fixed",
fixed = technic.gen_cable_nodebox(x1, y1, z1, x2, y2, z2, size)
},
+ on_construct = function()
+ technic.networks = {}
+ end,
+ on_destruct = function()
+ technic.networks = {}
+ end,
after_place_node = function(pos)
local node = minetest.get_node(pos)
technic.update_cables(pos, technic.get_cable_tier(node.name))
end
local get_network = function(pos1, tier)
- local cached = technic.networks[pos1]
+ local cached = technic.networks[minetest.hash_node_position(pos1)]
if cached and cached.tier == tier then
touch_nodes(cached.PR_nodes, tier)
touch_nodes(cached.BA_nodes, tier)
i, technic.machines[tier], tier)
i = i + 1
until all_nodes[i] == nil
- technic.networks[pos1] = {tier = tier, PR_nodes = PR_nodes, RE_nodes = RE_nodes, BA_nodes = BA_nodes}
+ technic.networks[minetest.hash_node_position(pos1)] = {tier = tier, PR_nodes = PR_nodes, RE_nodes = RE_nodes, BA_nodes = BA_nodes}
return PR_nodes, BA_nodes, RE_nodes
end