fix crafting recipe detection for wood nodes

This commit is contained in:
Evert Prants 2018-12-12 21:39:14 +02:00
parent ae58f848f7
commit b853f52bd6
No known key found for this signature in database
GPG Key ID: 1688DA83D222D0B5

@ -244,9 +244,11 @@ minetest.after(0.2, function ()
local assoc = {}
for _,wood in ipairs(wood_nodes) do
local recipes = minetest.get_all_craft_recipes(wood)
for _, recipe in ipairs(recipes) do
if recipe.items and #recipe.items == 1 then
assoc[recipe.items[1]] = wood
if recipes then
for _, recipe in ipairs(recipes) do
if recipe.items and #recipe.items == 1 then
assoc[recipe.items[1]] = wood
end
end
end
end