summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-12-10 22:39:53 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-12-10 22:39:53 -0500
commitb43a1036cae2fda49453a2c0a97b9ed2f6d16023 (patch)
tree98895b35799d1fb7324195a94fdc9478da74f57d
parent29da8992ec32e0123e971c4ffc98015fbc2ae3be (diff)
downloadpipeworks-b43a1036cae2fda49453a2c0a97b9ed2f6d16023.tar
pipeworks-b43a1036cae2fda49453a2c0a97b9ed2f6d16023.tar.gz
pipeworks-b43a1036cae2fda49453a2c0a97b9ed2f6d16023.tar.bz2
pipeworks-b43a1036cae2fda49453a2c0a97b9ed2f6d16023.tar.xz
pipeworks-b43a1036cae2fda49453a2c0a97b9ed2f6d16023.zip
catch a similar nil condition in the node breaker
-rw-r--r--node_breaker.lua2
1 files changed, 2 insertions, 0 deletions
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}