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