Better way to catch that incoming nil, return a real value on the way out

This commit is contained in:
Vanessa Ezekowitz 2013-12-10 21:18:29 -05:00
parent ebfa12205a
commit e4a7af5858
1 changed files with 2 additions and 0 deletions

View File

@ -28,6 +28,8 @@ 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 not node or not node.param2 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)