Log a warning when a craft has no width

This commit is contained in:
Oversword 2021-12-19 21:52:44 +00:00
parent 9c9a92213f
commit e8b979d5f3
1 changed files with 9 additions and 1 deletions

View File

@ -499,7 +499,15 @@ local function craftguide_craft(player, formname, fields)
local alternate = ui.alternate[player_name]
local craft = crafts[alternate]
if not craft.width or craft.width > 3 then return end
if not craft.width then
if not craft.output then
minetest.log("warning", "[unified_inventory] Craft has no output.")
else
minetest.log("warning", ("[unified_inventory] Craft for '%s' has no width."):format(craft.output))
end
return
end
if craft.width > 3 then return end
ui.craftguide_match_craft(player, "main", "craft", craft, amount)