From 8feefb185833f659bc3a6591f9f003d3b16c4120 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Tue, 10 Nov 2015 21:29:42 -0800 Subject: lua API change: use get_nodedef_field for drawtype. --- init.lua | 10 ++++++++-- 1 file 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 -- cgit v1.2.3