From 2c4d70fe0889e763c8d33ab8aefac00c0afd81a2 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Wed, 5 May 2021 18:48:41 -0500 Subject: [PATCH] Progress on mineleader. --- mineleader.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mineleader.lua b/mineleader.lua index 73ccf16..e68e3d2 100644 --- a/mineleader.lua +++ b/mineleader.lua @@ -373,14 +373,14 @@ local function moveTo(dest, range) end local xBlocked, yBlocked, zBlocked = false, false, false local oldPos = nil - while oldPos == nil or not vectorEqual(dest, position) do + while not vectorEqual(dest, position) do if oldPos ~= nil and vectorEqual(oldPos, position) then sendLog(FAILED, "Cannot proceed to due obstacle.") return end oldPos = vector.new(position.x, position.y, position.z); if position.x ~= dest.x then - if not orient(vector.new(dest.x - position.x, 0, 0), heading, rightAxis) then + if not orient(vector.new(dest.x - position.x, 0, 0):normalize(), heading, rightAxis) then sendLog(FAILED, "Unable to orient for X axis.") return end @@ -394,7 +394,7 @@ local function moveTo(dest, range) end end if position.z ~= dest.z then - if not orient(vector.new(0, 0, dest.z - position.z), heading, rightAxis) then + if not orient(vector.new(0, 0, dest.z - position.z):normalize(), heading, rightAxis) then sendLog(FAILED, "Unable to orient for Z axis.") return end