Skip to content

Commit

Permalink
only compare edge iterators if you are sure they refer to the same ro…
Browse files Browse the repository at this point in the history
…ute fix #14518
  • Loading branch information
behrisch committed Mar 15, 2024
1 parent 341a6d2 commit 28d54c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/microsim/MSBaseVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,11 +703,12 @@ MSBaseVehicle::hasValidRoute(std::string& msg, ConstMSRoutePtr route) const {
} else {
start = route->begin();
}
const bool checkJumps = route == myRoute; // the edge iterators in the stops are invalid otherwise
MSRouteIterator last = route->end() - 1;
// check connectivity, first
for (MSRouteIterator e = start; e != last; ++e) {
if ((*e)->allowedLanes(**(e + 1), myType->getVehicleClass()) == nullptr) {
if (!hasJump(e)) {
if (!checkJumps || !hasJump(e)) {
msg = TLF("No connection between edge '%' and edge '%'.", (*e)->getID(), (*(e + 1))->getID());
return false;
}
Expand Down

0 comments on commit 28d54c1

Please sign in to comment.