fix: crash the miner when cannot dig down

This commit is contained in:
Guillaume ARM 2024-05-08 21:49:34 +02:00
parent 7d6825f59d
commit 988bf73955

View File

@ -145,7 +145,12 @@ local function mineProcedure()
-- 1. Move -- 1. Move
if robotState.y > targetY then if robotState.y > targetY then
turtle.digDown() local ok, err = turtle.digDown()
if not ok then
error('Cannot dig down because ' .. err)
end
miner.robot.down() miner.robot.down()
elseif robotState.dir == 'FORWARD' and robotState.z < targetZ then elseif robotState.dir == 'FORWARD' and robotState.z < targetZ then
turtleUtils.digAll() turtleUtils.digAll()