Fix issue 1 (#5)
See #1 Co-authored-by: Anton Reinhard <s1509337@msx.tu-dresden.de> Reviewed-on: Rubydragon/fusion-speedrun#5
This commit is contained in:
parent
c66736cf44
commit
5bd13b022e
@ -341,19 +341,30 @@ function returnItems()
|
|||||||
|
|
||||||
faceTo(-1, 0)
|
faceTo(-1, 0)
|
||||||
|
|
||||||
-- already facing right direction, put items
|
local droppedAll = true
|
||||||
for slot = 1, maxCompareSlot do
|
|
||||||
-- put away compare slots' items except one
|
while true do
|
||||||
turtle.select(slot)
|
droppedAll = true
|
||||||
turtle.drop(turtle.getItemCount(slot) - 1)
|
-- already facing right direction, put items
|
||||||
end
|
for slot = 1, maxCompareSlot do
|
||||||
for slot = maxCompareSlot + 1, 16 do
|
-- put away compare slots' items except one
|
||||||
-- then drop everything else
|
turtle.select(slot)
|
||||||
if (turtle.getItemCount(slot) == 0) then
|
turtle.drop(turtle.getItemCount(slot) - 1)
|
||||||
|
if (turtle.getItemCount(slot) ~= 1) then
|
||||||
|
droppedAll = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for slot = maxCompareSlot + 1, 16 do
|
||||||
|
-- then drop everything else
|
||||||
|
turtle.select(slot)
|
||||||
|
turtle.drop()
|
||||||
|
if (turtle.getItemCount(slot) ~= 0) then
|
||||||
|
droppedAll = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if (droppedAll) then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
turtle.select(slot)
|
|
||||||
turtle.drop()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- necessary so the next mined block doesn't go in random places
|
-- necessary so the next mined block doesn't go in random places
|
||||||
|
Loading…
x
Reference in New Issue
Block a user