From 52590e9e2f2abdda8660dd0cb9c2225ef39ccea5 Mon Sep 17 00:00:00 2001 From: Alexander Klein Date: Wed, 24 May 2023 14:42:15 +0200 Subject: [PATCH] route return now the real last element of the list --- lib/Navigation/route.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Navigation/route.cpp b/lib/Navigation/route.cpp index f48d0f5..44ff347 100644 --- a/lib/Navigation/route.cpp +++ b/lib/Navigation/route.cpp @@ -148,15 +148,16 @@ Point Route::getNextPoint() { if (!this->started) return Point(); - if (this->it != this->points.end()) { + if (this->it != --this->points.end()) { this->it++; this->currentPoint++; return *this->it; // } else if (this->it == this->points.end() && this->currentPoint != this->points.size()) { // this->currentPoint++; // return *this->it; - } else - return Point(); + } + + return Point(); } Point Route::getPreviousPoint() {