fix compatibility lbm
This commit is contained in:
parent
00ca060a7e
commit
af87c9f370
@ -12,19 +12,17 @@ if not minetest.get_modpath("digiline_routing") then
|
|||||||
label = "Digicontrol digiline_routing compatibility",
|
label = "Digicontrol digiline_routing compatibility",
|
||||||
name = "digicontrol:routing_compat",
|
name = "digicontrol:routing_compat",
|
||||||
nodenames = {
|
nodenames = {
|
||||||
"digiline_routing:filter",
|
|
||||||
"digiline_routing:splitter",
|
|
||||||
"digiline_routing:filter_b",
|
"digiline_routing:filter_b",
|
||||||
"digiline_routing:splitter_b"
|
"digiline_routing:splitter_b"
|
||||||
},
|
},
|
||||||
action = function(pos, node)
|
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
|
local p = (node.param2 + 1) % 4
|
||||||
-- For some reason the node name will be the aliased one...
|
-- Replace invisible node
|
||||||
if node.name == "digicontrol:splitter" or node.name == "digicontrol:filter" then
|
minetest.set_node(pos, {name = connector, param2 = p})
|
||||||
minetest.swap_node(pos, {name = node.name, param2 = p})
|
-- Rotate main node
|
||||||
else
|
minetest.swap_node(pos2, {name = node2.name, param2 = p})
|
||||||
minetest.swap_node(pos, {name = connector, param2 = p})
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user