From 6c9b2890a7e0bff6e61a819f18a58b535906f866 Mon Sep 17 00:00:00 2001 From: oktal3700 Date: Sat, 27 Aug 2022 16:08:11 +0100 Subject: [PATCH] Remove wrong assert CG can be negative. --- src/blackmisc/aviation/aircraftsituation.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/blackmisc/aviation/aircraftsituation.cpp b/src/blackmisc/aviation/aircraftsituation.cpp index 388f8dc6a..a604a2d7e 100644 --- a/src/blackmisc/aviation/aircraftsituation.cpp +++ b/src/blackmisc/aviation/aircraftsituation.cpp @@ -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; }