Make failed registrations non-fatal

This commit is contained in:
Auke Kok 2017-04-20 10:00:49 -07:00
parent f4da43369f
commit 87181c431f

View File

@ -74,7 +74,10 @@ end
function flowerpot.register_node(nodename)
assert(nodename, "no nodename passed")
local nodedef = minetest.registered_nodes[nodename]
assert(nodedef, nodename .. " is not a known node")
if not nodedef then
minetest.log("error", nodename .. " is not a known node, unable to register flowerpot")
return false
end
local desc = nodedef.description
local name = nodedef.name:gsub(":", "_")