diff options
author | Auke Kok <sofar@foo-projects.org> | 2015-11-10 21:29:42 -0800 |
---|---|---|
committer | Auke Kok <sofar@foo-projects.org> | 2015-11-10 21:29:42 -0800 |
commit | 8feefb185833f659bc3a6591f9f003d3b16c4120 (patch) | |
tree | 304f78007203998d24b6482655d7c88dad0db63f | |
parent | 0ae4e61c7bd22209288c8092aa197cad9ec5e0d8 (diff) |
lua API change: use get_nodedef_field for drawtype.
-rw-r--r-- | init.lua | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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 |