Fix trunks mod start failure if some type of trunk does not exist.

This commit is contained in:
Rogier 2015-11-03 12:21:38 +01:00
parent 16db34a9f1
commit 2ad8c73f66

View File

@ -327,7 +327,9 @@ for i in pairs(TRuNKS) do
local TRuNK = TRuNKS[i][2]
if minetest.get_modpath(MoD) ~= nil then
local des = minetest.registered_nodes[MoD..":"..TRuNK].description
local node = minetest.registered_nodes[MoD..":"..TRuNK]
if node then
local des = node.description
minetest.register_node("trunks:"..TRuNK.."root", {
description = des.." Root",
@ -356,6 +358,9 @@ for i in pairs(TRuNKS) do
sounds = default.node_sound_wood_defaults(),
})
else
print(string.format("[Trunks] warning: tree type '%s:%s' not found", MoD, TRuNK))
end
end
end
end