summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-12-24 09:11:26 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-12-24 09:11:26 -0500
commit7488f6c091c04593bbcec4b555ac4a4493f83694 (patch)
tree3b63c9fd8ab4de47035ab57b56924a9bd5fc04b7
parent5dda1a465456fbb5fc292abefbc1c61abe2e6e1b (diff)
downloadpipeworks-7488f6c091c04593bbcec4b555ac4a4493f83694.tar
pipeworks-7488f6c091c04593bbcec4b555ac4a4493f83694.tar.gz
pipeworks-7488f6c091c04593bbcec4b555ac4a4493f83694.tar.bz2
pipeworks-7488f6c091c04593bbcec4b555ac4a4493f83694.tar.xz
pipeworks-7488f6c091c04593bbcec4b555ac4a4493f83694.zip
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).
-rw-r--r--autoplace_tubes.lua6
1 files changed, 1 insertions, 5 deletions
diff --git a/autoplace_tubes.lua b/autoplace_tubes.lua
index dfac997..ba181c0 100644
--- a/autoplace_tubes.lua
+++ b/autoplace_tubes.lua
@@ -17,11 +17,7 @@ end
--a function for determining which side of the node we are on
local function nodeside(node, tubedir)
- if not tubedir or
- not node or
- not (type(node.param2) == "number" and node.param2 > 0 and node.param2 < 23) then
- return "back"
- end
+ if node and (node.param2 < 0 or node.param2 > 23) then node.param2 = 0 end
--get a vector pointing back
local backdir = minetest.facedir_to_dir(node.param2)