diff --git a/mineleader.lua b/mineleader.lua index e4d80a4..ccd4583 100644 --- a/mineleader.lua +++ b/mineleader.lua @@ -410,8 +410,16 @@ local function moveTo(dest, relative) sendLog(FAILED, "Unable to orient for X axis.") return end + if relative then + forward = relHeading + right = relRightAxis + else + forward = heading + right = rightAxis + end xblocked = not attemptMoveForward() end + if position.y ~= dest.y then if dest.y - pos.y > 0 then yBlocked = not attemptMoveUp() @@ -419,6 +427,7 @@ local function moveTo(dest, relative) yBlocked = not attemptMoveDown() end end + if pos.z ~= dest.z then if not orient(vector.new(0, 0, dest.z - pos.z):normalize(), forward, right) then sendLog(FAILED, "Unable to orient for Z axis.") @@ -426,6 +435,13 @@ local function moveTo(dest, relative) end zBlocked = not attemptMoveForward() end + if relative then + forward = relHeading + right = relRightAxis + else + forward = heading + right = rightAxis + end end end