mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-30 05:51:23 +08:00
Style and check condition
This commit is contained in:
committed by
Roland Winklmeier
parent
a062607520
commit
f85c6bcc30
@@ -213,6 +213,8 @@ namespace BlackSimPlugin
|
|||||||
union FS_PBH
|
union FS_PBH
|
||||||
{
|
{
|
||||||
unsigned int pbh = 0; //!< Pitch/Bank/Heading as integer value
|
unsigned int pbh = 0; //!< Pitch/Bank/Heading as integer value
|
||||||
|
|
||||||
|
//! PBH
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
unsigned int unused : 1; //!< unused bit
|
unsigned int unused : 1; //!< unused bit
|
||||||
@@ -223,6 +225,6 @@ namespace BlackSimPlugin
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
} // ns
|
||||||
|
|
||||||
#endif // BLACKSIMPLUGIN_FS9_FS9SDK_H
|
#endif // guard
|
||||||
|
|||||||
@@ -1675,6 +1675,13 @@ namespace BlackSimPlugin
|
|||||||
position.Heading = situation.getHeading().value(CAngleUnit::deg());
|
position.Heading = situation.getHeading().value(CAngleUnit::deg());
|
||||||
position.Airspeed = static_cast<DWORD>(situation.getGroundSpeed().valueInteger(CSpeedUnit::kts()));
|
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
|
// MSFS has inverted pitch and bank angles
|
||||||
position.Pitch = -situation.getPitch().value(CAngleUnit::deg());
|
position.Pitch = -situation.getPitch().value(CAngleUnit::deg());
|
||||||
position.Bank = -situation.getBank().value(CAngleUnit::deg());
|
position.Bank = -situation.getBank().value(CAngleUnit::deg());
|
||||||
|
|||||||
Reference in New Issue
Block a user