Fix reverse item lookup ("usage") broken by 5ac2558

> return { specname }

This returned a number-indexed table whereas the code expects a name-indexed table
This commit is contained in:
SmallJoker 2022-04-22 22:01:15 +02:00
parent fa079c31b6
commit 14da1a3dd0
1 changed files with 2 additions and 1 deletions

View File

@ -151,7 +151,7 @@ minetest.after(0.01, function()
-- Step 2: Find all matching items for the given spec (groups)
local function get_matching_spec_items(specname)
if specname:sub(1,6) ~= "group:" then
return { specname }
return { [specname] = true }
end
local accepted = {}
@ -177,6 +177,7 @@ minetest.after(0.01, function()
end
for _, recipes in pairs(ui.crafts_for.recipe) do
-- List of crafts that return this item string (variable "_")
for _, recipe in ipairs(recipes) do
local ingredient_items = {}
for _, spec in pairs(recipe.items) do