Browse Source

use the correct return values

Sven Czarnian 3 years ago
parent
commit
7238d6b92e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/types/Inbound.cpp

+ 2 - 2
src/types/Inbound.cpp

@@ -233,7 +233,7 @@ int Inbound::matchToPredictedPath(const EuroScopePlugIn::CFlightPlanPositionPred
     trackmiles = 0_m;
 
     if (1 >= predictions.GetPointsNumber())
-        return 0;
+        return 1;
 
     std::vector<Length> distances;
     distances.reserve(static_cast<std::size_t>(predictions.GetPointsNumber()) - 1);
@@ -250,7 +250,7 @@ int Inbound::matchToPredictedPath(const EuroScopePlugIn::CFlightPlanPositionPred
     /* calculate the theoretical maximum distance (assuming one minute steps) and validate the distance */
     const auto& maxDistance = groundspeed * 1_min;
     if (gsl::at(distances, idx) > maxDistance)
-        return 0;
+        return predictions.GetPointsNumber();
 
     if (idx + 1 < static_cast<std::size_t>(predictions.GetPointsNumber()) && 0 != idx) {
         const auto bearingCurrent = position.bearingTo(GeoCoordinate(__convert(predictions.GetPosition(idx))));