summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAuke Kok <sofar@foo-projects.org>2015-11-10 21:29:42 -0800
committerAuke Kok <sofar@foo-projects.org>2015-11-10 21:29:42 -0800
commit8feefb185833f659bc3a6591f9f003d3b16c4120 (patch)
tree304f78007203998d24b6482655d7c88dad0db63f
parent0ae4e61c7bd22209288c8092aa197cad9ec5e0d8 (diff)
lua API change: use get_nodedef_field for drawtype.
-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