More sanity checks on the nodeside() function, courtesy ShadowNinja

This commit is contained in:
Vanessa Ezekowitz 2013-12-10 21:39:47 -05:00
parent e4a7af5858
commit 29da8992ec
1 changed files with 5 additions and 1 deletions

View File

@ -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)