Fix potential crash during sprite creation
This commit is contained in:
parent
c421c49916
commit
dcc4068e46
|
@ -39,6 +39,8 @@ local function cache_groups(group, groups)
|
|||
|
||||
for _, item in ipairs(items) do
|
||||
local def = reg_items[item]
|
||||
|
||||
if def then
|
||||
local tiles = def.tiles or def.tile_images
|
||||
local texture = true_str(def.inventory_image) and def.inventory_image --or tiles[1]
|
||||
|
||||
|
@ -54,12 +56,15 @@ local function cache_groups(group, groups)
|
|||
if c == lim then break end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if c > 1 then
|
||||
sprite = sprite:gsub("WxH", px .. "x" .. px * c)
|
||||
|
||||
i3.groups[group].sprite = sprite
|
||||
i3.groups[group].count = c
|
||||
end
|
||||
end
|
||||
|
||||
local function get_item_usages(item, recipe, added)
|
||||
if is_group(item) then
|
||||
|
|
Ŝarĝante…
Reference in New Issue