Added rounding values so no infinite moving loop.

This commit is contained in:
Harrison Deng 2021-05-07 16:09:48 -05:00
parent 683b61a640
commit e74e1f4eef

View File

@ -366,6 +366,7 @@ local function moveBy(delta, forward, right)
end end
local function moveTo(dest) local function moveTo(dest)
dest = vector.new(tonumber(string.format("%.0f", dest.x)), tonumber(string.format("%.0f", dest.y)), tonumber(string.format("%.0f", dest.z)))
sendLog(MOVETO, "Attempting to move by (" .. dest.x .. "," .. dest.y .. "," .. dest.z .. ") (x,y,z).") sendLog(MOVETO, "Attempting to move by (" .. dest.x .. "," .. dest.y .. "," .. dest.z .. ") (x,y,z).")
if position == nil or heading == nil then if position == nil or heading == nil then
sendLog(FAILED, "Position or heading is invalid.") sendLog(FAILED, "Position or heading is invalid.")