Allow autocrafting to consume all, now that crafting terminals support listing crafts.

This commit is contained in:
Mike Stump 2024-01-13 16:38:50 -08:00
parent 38917de3ff
commit 747242b84a

@ -259,10 +259,8 @@ local function build(net, cpos, inv, name, count, stack, sink, time)
replace = false
break
end
-- Don't consume the last item by autocrafting
istack:set_count(count+1)
local hasit = inv:contains_item("main", istack)
istack:set_count(count)
local hasit = inv:contains_item("main", istack)
me.log("ac checking "..name, "error")
if hasit then
me.log("ac grabbing "..name, "error")
@ -565,8 +563,7 @@ function me.autocraft(autocrafterCache, cpos, net, linv, inv, count)
replace = false
break
end
-- Don't consume the last item by autocrafting
stack:set_count(count+1)
stack:set_count(count)
replace = replace and inv:contains_item("main", stack)
end
if replace then