summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index 0278320..a749fc0 100644
--- a/init.lua
+++ b/init.lua
@@ -111,7 +111,10 @@ local function node_is_plant(node)
end
local name = node.name
- local drawtype = minetest.registered_nodes[name].drawtype
+ if not minetest.registered_nodes[name] then
+ return false
+ end
+ local drawtype = get_nodedef_field(name, "drawtype")
if drawtype == "plantlike" then
return true
end
@@ -170,7 +173,10 @@ local function node_is_liquid(node)
end
local name = node.name
- local drawtype = minetest.registered_nodes[name].drawtype
+ if not minetest.registered_nodes[name] then
+ return false
+ end
+ local drawtype = get_nodedef_field(name, "drawtype")
if drawtype then
if (drawtype == "liquid") or (drawtype == "flowingliquid") then
return true