mirror of
https://github.com/joe7575/techpack.git
synced 2024-11-29 10:33:47 +01:00
Added refill code to Warehouse and pushing chest
This commit is contained in:
parent
6a0f0b6560
commit
6507e18a90
@ -110,7 +110,8 @@ local function shift_items(pos, elapsed)
|
|||||||
for i = 0,7 do
|
for i = 0,7 do
|
||||||
local idx = ((i + offs) % 8) + 1
|
local idx = ((i + offs) % 8) + 1
|
||||||
local stack = inv:get_stack("shift", idx)
|
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
|
if tubelib.push_items(pos, "R", stack, player_name) then
|
||||||
-- The effort is needed here for the case the
|
-- The effort is needed here for the case the
|
||||||
-- pusher pushes into its own chest.
|
-- pusher pushes into its own chest.
|
||||||
@ -121,7 +122,12 @@ local function shift_items(pos, elapsed)
|
|||||||
aging(pos, meta)
|
aging(pos, meta)
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
set_state(meta, "blocked")
|
-- Complete stack rejected
|
||||||
|
if count == stack:get_count() then
|
||||||
|
set_state(meta, "blocked")
|
||||||
|
else
|
||||||
|
inv:set_stack("shift", idx, stack)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user