summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-12-10 21:39:47 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-12-10 21:41:15 -0500
commit29da8992ec32e0123e971c4ffc98015fbc2ae3be (patch)
treef5fde4b76940a5a453024d75019b3e2126c2c286
parente4a7af5858949ed786396abf0edd7f98c1e28941 (diff)
downloadpipeworks-29da8992ec32e0123e971c4ffc98015fbc2ae3be.tar
pipeworks-29da8992ec32e0123e971c4ffc98015fbc2ae3be.tar.gz
pipeworks-29da8992ec32e0123e971c4ffc98015fbc2ae3be.tar.bz2
pipeworks-29da8992ec32e0123e971c4ffc98015fbc2ae3be.tar.xz
pipeworks-29da8992ec32e0123e971c4ffc98015fbc2ae3be.zip
More sanity checks on the nodeside() function, courtesy ShadowNinja
-rw-r--r--autoplace_tubes.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/autoplace_tubes.lua b/autoplace_tubes.lua
index 4bb31bc..518caf8 100644
--- a/autoplace_tubes.lua
+++ b/autoplace_tubes.lua
@@ -28,7 +28,11 @@ 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 node.param2 then return "back" end
+ if not tubedir or
+ 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
local backdir = minetest.facedir_to_dir(node.param2)