route return now the real last element of the list
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user