Style and check condition

This commit is contained in:
Klaus Basan
2018-09-02 14:36:14 +02:00
committed by Roland Winklmeier
parent a062607520
commit f85c6bcc30
2 changed files with 25 additions and 16 deletions

View File

@@ -1675,6 +1675,13 @@ namespace BlackSimPlugin
position.Heading = situation.getHeading().value(CAngleUnit::deg());
position.Airspeed = static_cast<DWORD>(situation.getGroundSpeed().valueInteger(CSpeedUnit::kts()));
// sanity check
if (CBuildConfig::isLocalDeveloperDebugBuild() && situation.getGroundSpeed().isNegativeWithEpsilonConsidered())
{
BLACK_VERIFY_X(false, Q_FUNC_INFO, "Negative speed");
position.Airspeed = 0;
}
// MSFS has inverted pitch and bank angles
position.Pitch = -situation.getPitch().value(CAngleUnit::deg());
position.Bank = -situation.getBank().value(CAngleUnit::deg());