mirror of
https://github.com/mt-mods/pipeworks.git
synced 2024-12-26 02:40:23 +01:00
Fix glitch in tube autorouter
(brain-o in how I was handling unknown/bad nodes being passed to it. this works better and lets the code do its job properly).
This commit is contained in:
parent
5dda1a4654
commit
7488f6c091
@ -17,11 +17,7 @@ end
|
|||||||
|
|
||||||
--a function for determining which side of the node we are on
|
--a function for determining which side of the node we are on
|
||||||
local function nodeside(node, tubedir)
|
local function nodeside(node, tubedir)
|
||||||
if not tubedir or
|
if node and (node.param2 < 0 or node.param2 > 23) then node.param2 = 0 end
|
||||||
not node or
|
|
||||||
not (type(node.param2) == "number" and node.param2 > 0 and node.param2 < 23) then
|
|
||||||
return "back"
|
|
||||||
end
|
|
||||||
|
|
||||||
--get a vector pointing back
|
--get a vector pointing back
|
||||||
local backdir = minetest.facedir_to_dir(node.param2)
|
local backdir = minetest.facedir_to_dir(node.param2)
|
||||||
|
Loading…
Reference in New Issue
Block a user