diff --git a/miner.lua b/miner.lua index d9b81de..49a26b2 100644 --- a/miner.lua +++ b/miner.lua @@ -196,6 +196,10 @@ local function returnHomeProcedure() if robotState.x == 0 and robotState.y == 0 and robotState.z == 0 then miner.mission = 'unload' elseif robotState.x == 0 and robotState.z == 0 then + while miner.robot.getState().dir ~= 'FORWARD' do + miner.robot.turnRight() + end + miner.robot.up() elseif robotState.x > 0 then if robotState.dir == 'FORWARD' then