From af87c9f370820b373fe416b7819e0744ac2a150b Mon Sep 17 00:00:00 2001 From: OgelGames Date: Sun, 21 Feb 2021 17:22:26 +1100 Subject: [PATCH] fix compatibility lbm --- compatibility.lua | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/compatibility.lua b/compatibility.lua index 317236d..113e5de 100644 --- a/compatibility.lua +++ b/compatibility.lua @@ -12,19 +12,17 @@ if not minetest.get_modpath("digiline_routing") then label = "Digicontrol digiline_routing compatibility", name = "digicontrol:routing_compat", nodenames = { - "digiline_routing:filter", - "digiline_routing:splitter", "digiline_routing:filter_b", "digiline_routing:splitter_b" }, action = function(pos, node) + local pos2 = vector.subtract(pos, minetest.facedir_to_dir(node.param2)) + local node2 = minetest.get_node(pos2) local p = (node.param2 + 1) % 4 - -- For some reason the node name will be the aliased one... - if node.name == "digicontrol:splitter" or node.name == "digicontrol:filter" then - minetest.swap_node(pos, {name = node.name, param2 = p}) - else - minetest.swap_node(pos, {name = connector, param2 = p}) - end + -- Replace invisible node + minetest.set_node(pos, {name = connector, param2 = p}) + -- Rotate main node + minetest.swap_node(pos2, {name = node2.name, param2 = p}) end }) end