From 254fcdbc285df6314a0089496536f86232d9ad20 Mon Sep 17 00:00:00 2001
From: Auke Kok <auke-jan.h.kok@intel.com>
Date: Mon, 6 Apr 2015 13:45:47 -0700
Subject: Harden all these functions against "ignore" nodes.

---
 init.lua | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

(limited to 'init.lua')

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
-- 
cgit v1.2.3