gps.lua: Added nil and nan checks

This commit is contained in:
Anavrins 2019-12-11 11:38:12 -05:00
parent 9e3cf50ccc
commit cc80e08407
1 changed files with 1 additions and 1 deletions

View File

@ -98,7 +98,7 @@ function GPS.trilaterate(tFixes)
if pos2 then if pos2 then
pos1, pos2 = narrow(pos1, pos2, tFixes[1]) pos1, pos2 = narrow(pos1, pos2, tFixes[1])
end end
if not pos2 then if not pos2 and pos1 and not (pos1.x ~= pos1.x) then
return pos1, attemps return pos1, attemps
end end
end end