From: Vanessa Ezekowitz Date: Wed, 11 Dec 2013 03:39:53 +0000 (-0500) Subject: catch a similar nil condition in the node breaker X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=b43a1036cae2fda49453a2c0a97b9ed2f6d16023;p=zefram%2Fminetest%2Fpipeworks.git catch a similar nil condition in the node breaker --- diff --git a/node_breaker.lua b/node_breaker.lua index 23ff533..bffb27c 100644 --- a/node_breaker.lua +++ b/node_breaker.lua @@ -102,6 +102,8 @@ end function break_node (pos, facedir) --locate the outgoing velocity, front, and back of the node via facedir_to_dir + if type(facedir) ~= "number" or facedir < 0 or facedir > 23 then return end + local vel = minetest.facedir_to_dir(facedir); local front = {x=pos.x - vel.x, y=pos.y - vel.y, z=pos.z - vel.z} local back = {x=pos.x + vel.x, y=pos.y + vel.y, z=pos.z + vel.z}