route return now the real last element of the list

This commit is contained in:
2023-05-24 14:42:15 +02:00
parent 56f506e1b5
commit 52590e9e2f
+3 -2
View File
@@ -148,14 +148,15 @@ Point Route::getNextPoint() {
if (!this->started) if (!this->started)
return Point(); return Point();
if (this->it != this->points.end()) { if (this->it != --this->points.end()) {
this->it++; this->it++;
this->currentPoint++; this->currentPoint++;
return *this->it; return *this->it;
// } else if (this->it == this->points.end() && this->currentPoint != this->points.size()) { // } else if (this->it == this->points.end() && this->currentPoint != this->points.size()) {
// this->currentPoint++; // this->currentPoint++;
// return *this->it; // return *this->it;
} else }
return Point(); return Point();
} }