Compare commits

...

2 Commits
1.7 ... 1.7.1

Author SHA1 Message Date
c91f787cb2 Correct condition 2022-06-28 01:24:36 +02:00
dcc4068e46 Fix potential crash during sprite creation 2022-06-28 01:03:41 +02:00

View File

@ -42,7 +42,7 @@ local function cache_groups(group, groups)
local tiles = def.tiles or def.tile_images
local texture = true_str(def.inventory_image) and def.inventory_image --or tiles[1]
if is_cube(def.drawtype) then
if def.drawtype and is_cube(def.drawtype) then
texture = get_cube(tiles)
elseif texture then
texture = texture:gsub("%^", "\\^"):gsub(":", "\\:") .. "\\^[resize\\:150x150"
@ -55,10 +55,12 @@ local function cache_groups(group, groups)
end
end
sprite = sprite:gsub("WxH", px .. "x" .. px * c)
if c > 1 then
sprite = sprite:gsub("WxH", px .. "x" .. px * c)
i3.groups[group].sprite = sprite
i3.groups[group].count = c
i3.groups[group].sprite = sprite
i3.groups[group].count = c
end
end
local function get_item_usages(item, recipe, added)