diff options
author | Auke Kok <auke-jan.h.kok@intel.com> | 2015-04-06 13:45:47 -0700 |
---|---|---|
committer | Auke Kok <auke-jan.h.kok@intel.com> | 2015-04-06 13:45:47 -0700 |
commit | 254fcdbc285df6314a0089496536f86232d9ad20 (patch) | |
tree | 2bdce7158bce19f9c59f545c17add952007ac78a | |
parent | f22127a89270eed8d9c17dd16c112222b71b98f1 (diff) |
Harden all these functions against "ignore" nodes.
-rw-r--r-- | init.lua | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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 |