crafting: bugfix crash on lookup

This commit is contained in:
Alexander Weber 2017-05-11 10:44:37 +02:00
parent ded7eb9a8b
commit 142bb20e4b

View File

@ -41,15 +41,15 @@ end
-- Update fields
function craft_preview:setCraft(craft)
local width = craft.width
if #craft.items == 1 then
width = 1
end
for x = 1, 3 do
for y = 1, 3 do
local item = nil
if craft then
local width = craft.width
if #craft.items == 1 then
width = 1
end
if not width or width == 0 then
item = craft.items[(y-1)*3+x]
elseif width == 1 then