1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-04-21 10:13:19 +00:00

Allow clients to fallback to default GPS usage for 'old' hosts.

This commit is contained in:
Matthew Wilbern 2023-11-11 02:34:40 -07:00 committed by GitHub
parent 4ced8429ad
commit 7a69b6ae00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -149,7 +149,7 @@ function locate(_nTimeout, _bDebug)
if sSide == sModemSide and sChannel == CHANNEL_GPS and sReplyChannel == CHANNEL_GPS and nDistance then
-- Received the correct message from the correct modem: use it to determine position
if type(tMessage) == "table" and #tMessage == 4 and tonumber(tMessage[1]) and tonumber(tMessage[2]) and tonumber(tMessage[3]) and tonumber(tMessage[4]) then
local tFix = { vPosition = vector.new(tMessage[1], tMessage[2], tMessage[3]), nDistance = tMessage[4] }
local tFix = { vPosition = vector.new(tMessage[1], tMessage[2], tMessage[3]), nDistance = tonumber(tMessage[4]) and tMessage[4] or nDistance }
if _bDebug then
print(tFix.nDistance .. " metres from " .. tostring(tFix.vPosition))
end