Remove wrong assert

CG can be negative.
This commit is contained in:
oktal3700
2022-08-27 16:08:11 +01:00
committed by GitHub
parent ddc7b3f87b
commit 6c9b2890a7

View File

@@ -667,7 +667,6 @@ namespace BlackMisc::Aviation
CAircraftSituation::IsOnGround CAircraftSituation::isOnGroundByElevation(const CLength &cg) const
{
Q_ASSERT_X(!cg.isNegativeWithEpsilonConsidered(), Q_FUNC_INFO, "CG must not be negative");
const CLength groundDistance = this->getGroundDistance(cg);
if (groundDistance.isNull()) { return OnGroundSituationUnknown; }
if (groundDistance.isNegativeWithEpsilonConsidered()) { return OnGround; }
@@ -676,7 +675,7 @@ namespace BlackMisc::Aviation
{
// smaller than percentage from CG
const CLength cgFactor(cg * 0.1);
if (groundDistance.abs() < cgFactor) { return OnGround; }
if (groundDistance.abs() < cgFactor.abs()) { return OnGround; }
}
return NotOnGround;
}