Skip to content

Commit

Permalink
rebuild bestLanes upon stop removal ref #14696
Browse files Browse the repository at this point in the history
Signed-off-by: m-kro <m.barthauer@t-online.de>
  • Loading branch information
m-kro committed Apr 11, 2024
1 parent 1328f89 commit abaea7a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libsumo/Vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,11 @@ Vehicle::replaceStop(const std::string& vehID,
if (!vehicle->rerouteBetweenStops(nextStopIndex, "traci:replaceStop", (teleport & 1), error)) {
throw TraCIException("Stop replacement failed for vehicle '" + vehID + "' (" + error + ").");
}
} else {
MSVehicle* msVeh = dynamic_cast<MSVehicle*>(vehicle);
if (msVeh->getLane() != nullptr) {
msVeh->updateBestLanes(true);
}
}
if (!ok) {
throw TraCIException("Stop replacement failed for vehicle '" + vehID + "' (invalid nextStopIndex).");
Expand Down

0 comments on commit abaea7a

Please sign in to comment.