Fixing moveto

This commit is contained in:
Harrison Deng 2021-05-03 18:26:09 -05:00
parent e6d75af1f7
commit 48af2c55cf

View File

@ -374,8 +374,8 @@ local function moveTo(dest, range)
end
local xBlocked, yBlocked, zBlocked = false, false, false
local oldPos = nil
while not vectorEqual(dest, position) do
if vectorEqual(oldPos, position) then
while oldPos == nil or not vectorEqual(dest, position) do
if oldPos ~= nil and vectorEqual(oldPos, position) then
sendLog(FAILED, "Cannot proceed to due obstacle.")
return
end