From: Vanessa Ezekowitz Date: Wed, 11 Dec 2013 02:18:29 +0000 (-0500) Subject: Better way to catch that incoming nil, return a real value on the way out X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=e4a7af5858949ed786396abf0edd7f98c1e28941;p=zefram%2Fminetest%2Fpipeworks.git Better way to catch that incoming nil, return a real value on the way out --- diff --git a/autoplace_tubes.lua b/autoplace_tubes.lua index f7f7eb7..4bb31bc 100644 --- a/autoplace_tubes.lua +++ b/autoplace_tubes.lua @@ -28,6 +28,8 @@ 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 + --get a vector pointing back local backdir = minetest.facedir_to_dir(node.param2)