mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-26 12:33:43 +01:00
Fix crash with groups_to_items()
This commit is contained in:
parent
c9c2bf03de
commit
270dc19ec1
11
init.lua
11
init.lua
@ -592,11 +592,15 @@ local function groups_to_items(groups, get_all)
|
|||||||
local names = {}
|
local names = {}
|
||||||
for name, def in pairs(reg_items) do
|
for name, def in pairs(reg_items) do
|
||||||
if item_has_groups(def.groups, groups) then
|
if item_has_groups(def.groups, groups) then
|
||||||
names[#names + 1] = name
|
if get_all then
|
||||||
|
names[#names + 1] = name
|
||||||
|
else
|
||||||
|
return name
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return names
|
return get_all and names or ""
|
||||||
end
|
end
|
||||||
|
|
||||||
local function repairable(tool)
|
local function repairable(tool)
|
||||||
@ -798,8 +802,7 @@ local function get_grid_fs(fs, rcp, spacing)
|
|||||||
|
|
||||||
if is_group(item) then
|
if is_group(item) then
|
||||||
groups = extract_groups(item)
|
groups = extract_groups(item)
|
||||||
local items = groups_to_items(groups)
|
item = groups_to_items(groups)
|
||||||
item = items[1] or items
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local label = groups and "\nG" or ""
|
local label = groups and "\nG" or ""
|
||||||
|
Loading…
Reference in New Issue
Block a user