Merge pull request #100 from 0siribix/master

Added refill code to Warehouse and pushing chest
This commit is contained in:
Joachim Stolberg 2021-08-09 20:53:33 +02:00 committed by GitHub
commit 7f7c568a08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -110,7 +110,8 @@ local function shift_items(pos, elapsed)
for i = 0,7 do
local idx = ((i + offs) % 8) + 1
local stack = inv:get_stack("shift", idx)
if stack:get_count() > 0 then
local count = stack:get_count()
if count > 0 then
if tubelib.push_items(pos, "R", stack, player_name) then
-- The effort is needed here for the case the
-- pusher pushes into its own chest.
@ -121,7 +122,12 @@ local function shift_items(pos, elapsed)
aging(pos, meta)
return true
else
-- Complete stack rejected
if count == stack:get_count() then
set_state(meta, "blocked")
else
inv:set_stack("shift", idx, stack)
end
end
end
end