From 4cba73e9d063bf2d114514d001364e8cf2c537a3 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Sun, 9 May 2021 13:19:42 -0500 Subject: [PATCH] Attempt at fixing heading. --- mineleader.lua | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/mineleader.lua b/mineleader.lua index e1d9258..19aff31 100644 --- a/mineleader.lua +++ b/mineleader.lua @@ -436,13 +436,7 @@ local function quarry(x, y, z, relative, pattern) z = tonumber(z) local forward; local right; - if relative then - forward = relHeading - right = relRightAxis - else - forward = heading - right = rightAxis - end + sendLog(QUARRY, "Starting quarry of (x length,depth,z length): " .. x .. "," .. y .. "," .. z .. " with a not pattern of: " .. pattern) for yDelta=1,math.abs(y) do if (y > 0) then @@ -475,6 +469,13 @@ local function quarry(x, y, z, relative, pattern) else orient(vector.new(0, 0, z), forward, right) end + if relative then + forward = relHeading + right = relRightAxis + else + forward = heading + right = rightAxis + end success = success and attemptBreakUp(pattern) success = success and attemptBreakDown(pattern) success = success and attemptBreakFront(pattern) @@ -492,6 +493,13 @@ local function quarry(x, y, z, relative, pattern) sendLog(FAILED, "Unable to move to next row.") return end + if relative then + forward = relHeading + right = relRightAxis + else + forward = heading + right = rightAxis + end end end end