From 4d2ee3caa2b4c20336dae55f0ee3142bacbb508c Mon Sep 17 00:00:00 2001 From: Alexander Klein Date: Wed, 28 Dec 2022 14:59:26 +0100 Subject: [PATCH] bug fix, last point are was not reachable --- lib/Navigation/route.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Navigation/route.cpp b/lib/Navigation/route.cpp index 75b302f..ceccad1 100644 --- a/lib/Navigation/route.cpp +++ b/lib/Navigation/route.cpp @@ -110,8 +110,10 @@ Point Route::getNextPoint() { this->it++; this->currentPoint++; return *this->it; - } - else + } else if (this->it == this->points.end() && this->currentPoint != this->points.size()) { + this->currentPoint++; + return *this->it; + } else return Point(0, 0); }