From 988bf739553901e29022eaf7571595013fb97a3c Mon Sep 17 00:00:00 2001 From: Guillaume ARM Date: Wed, 8 May 2024 21:49:34 +0200 Subject: [PATCH] fix: crash the miner when cannot dig down --- miner.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/miner.lua b/miner.lua index 5c3a53e..41705c9 100644 --- a/miner.lua +++ b/miner.lua @@ -145,7 +145,12 @@ local function mineProcedure() -- 1. Move 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() elseif robotState.dir == 'FORWARD' and robotState.z < targetZ then turtleUtils.digAll()