mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 04:25:42 +08:00
Ref T470 CTraffic::getRemoteAircraftData uses NaN to represent
an unknown vertical offset.
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
// clazy:excludeall=reserve-candidates
|
// clazy:excludeall=reserve-candidates
|
||||||
|
|
||||||
@@ -441,13 +442,13 @@ namespace XSwiftBus
|
|||||||
double groundElevation = plane->terrainProbe.getElevation(latDeg, lonDeg, plane->position.elevation);
|
double groundElevation = plane->terrainProbe.getElevation(latDeg, lonDeg, plane->position.elevation);
|
||||||
if (std::isnan(groundElevation)) { groundElevation = 0.0; }
|
if (std::isnan(groundElevation)) { groundElevation = 0.0; }
|
||||||
double fudgeFactor = 3.0;
|
double fudgeFactor = 3.0;
|
||||||
XPMPGetVerticalOffset(plane->id, &fudgeFactor);
|
bool hasOffset = XPMPGetVerticalOffset(plane->id, &fudgeFactor);
|
||||||
|
|
||||||
callsigns.push_back(requestedCallsign);
|
callsigns.push_back(requestedCallsign);
|
||||||
latitudesDeg.push_back(latDeg);
|
latitudesDeg.push_back(latDeg);
|
||||||
longitudesDeg.push_back(lonDeg);
|
longitudesDeg.push_back(lonDeg);
|
||||||
elevationsM.push_back(groundElevation);
|
elevationsM.push_back(groundElevation);
|
||||||
verticalOffsets.push_back(fudgeFactor);
|
verticalOffsets.push_back(hasOffset ? fudgeFactor : std::numeric_limits<decltype(fudgeFactor)>::quiet_NaN());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user