Skip to content

Commit

Permalink
Ignore negative pressure altitude values (#151)
Browse files Browse the repository at this point in the history
Weird altitude anomalies occur if the XP12 pressure altitude dataref value is negative.
  • Loading branch information
justinshannon committed Feb 17, 2023
1 parent 1d718e2 commit 3b5ceeb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/src/network/networkmanager.cpp
Expand Up @@ -959,6 +959,10 @@ namespace xpilot
return altitude;
}

if(m_userAircraftData.AltitudePressure < 0) {
return altitude;
}

double verticalDistance = std::abs(m_userAircraftData.AltitudePressure - altitude);
if(verticalDistance > 6000.0) {
return altitude;
Expand Down

0 comments on commit 3b5ceeb

Please sign in to comment.