summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAuke Kok <auke-jan.h.kok@intel.com>2015-04-06 13:45:47 -0700
committerAuke Kok <auke-jan.h.kok@intel.com>2015-04-06 13:45:47 -0700
commit254fcdbc285df6314a0089496536f86232d9ad20 (patch)
tree2bdce7158bce19f9c59f545c17add952007ac78a
parentf22127a89270eed8d9c17dd16c112222b71b98f1 (diff)
Harden all these functions against "ignore" nodes.
-rw-r--r--init.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index efa24fa..30c1127 100644
--- a/init.lua
+++ b/init.lua
@@ -103,6 +103,9 @@ local function node_is_plant(node)
if not node then
return false
end
+ if node.name == "ignore" then
+ return false
+ end
local name = node.name
local drawtype = minetest.registered_nodes[name].drawtype
@@ -124,6 +127,9 @@ local function node_is_water_source(node)
if not node then
return false
end
+ if node.name == "ignore" then
+ return false
+ end
return (node.name == "default:water_source")
end
@@ -132,6 +138,9 @@ local function node_is_water(node)
if not node then
return false
end
+ if node.name == "ignore" then
+ return false
+ end
return ((node.name == "default:water_source") or
(node.name == "default:water_flowing"))
@@ -141,6 +150,9 @@ local function node_is_lava(node)
if not node then
return false
end
+ if node.name == "ignore" then
+ return false
+ end
return ((node.name == "default:lava_source") or
(node.name == "default:lava_flowing"))
@@ -150,6 +162,9 @@ local function node_is_liquid(node)
if not node then
return false
end
+ if node.name == "ignore" then
+ return false
+ end
local name = node.name
local drawtype = minetest.registered_nodes[name].drawtype