Changed to floor instead of string.

This commit is contained in:
Harrison Deng 2021-05-07 16:44:58 -05:00
parent 568ab85cc7
commit 5e95f20889

View File

@ -366,7 +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))) dest = vector.new(math.floor(dest.x), math.floor(dest.y), math.floor(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.")