Craft guide : check for stack of width 0

This commit is contained in:
jp 2015-12-02 23:30:21 +01:00
parent e5ea00e966
commit 3c83904eb0

View File

@ -68,8 +68,16 @@ function worktable.craft_output_recipe(pos, start_i, pagenum, stackname)
if stack_count and inv:is_empty("item_craft_input") then
inv:add_item("item_craft_input", stackname.." "..stack_count-1)
end
if stack_width == 0 or stack_width == 1 then
if stack_width == 0 then
if #stack_items <= 4 then
formspec = formspec.."list[context;craft_output_recipe;5,5.3;2,2;]"
inv:set_size("craft_output_recipe", 2*2)
else
formspec = formspec.."list[context;craft_output_recipe;5,5.3;3,3;]"
inv:set_size("craft_output_recipe", 3*3)
end
elseif stack_width == 1 then
if #stack_items == 1 then
formspec = formspec.."list[context;craft_output_recipe;5,6.3;1,1;]"
else