mirror of
https://github.com/joe7575/techpack.git
synced 2024-11-22 07:13:48 +01:00
Merge pull request #100 from 0siribix/master
Added refill code to Warehouse and pushing chest
This commit is contained in:
commit
7f7c568a08
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user