From 343c7946d9014bf111e25a7a225a1b6f5746992b Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz <vanessaezekowitz@gmail.com> Date: Fri, 10 Mar 2017 20:15:38 +0100 Subject: [PATCH] power monitor changes New textures, uses facedir, connects from the back as well. --- technic/machines/register/cables.lua | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/technic/machines/register/cables.lua b/technic/machines/register/cables.lua index a7e72a3..04c6096 100644 --- a/technic/machines/register/cables.lua +++ b/technic/machines/register/cables.lua @@ -20,8 +20,13 @@ {x=pos.x, y=pos.y, z=pos.z+1}, {x=pos.x, y=pos.y, z=pos.z-1}} for _,connected_pos in pairs(positions) do - if technic.cables[minetest.hash_node_position(connected_pos)] then - technic.networks[technic.cables[minetest.hash_node_position(connected_pos)]] = nil + local net = technic.cables[minetest.hash_node_position(connected_pos)] + if net and technic.networks[net] then + for _,v in pairs(technic.networks[net].all_nodes) do + local pos1 = minetest.hash_node_position(v) + technic.cables[pos1] = nil + end + technic.networks[net] = nil end end end -- Gitblit v1.8.0