Skip to content

Commit

Permalink
fixing offset calculation for movetoxy on junctions #1922
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Apr 19, 2024
1 parent e0e7efb commit 84880fe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/microsim/MSVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6452,6 +6452,9 @@ double
MSVehicle::getDistanceToPosition(double destPos, const MSEdge* destEdge) const {
double distance = std::numeric_limits<double>::max();
if (isOnRoad() && destEdge != nullptr) {
if (&myLane->getEdge() == destEdge && getPositionOnLane() < destPos) {
return destPos - getPositionOnLane();
}
if (myLane->isInternal()) {
// vehicle is on inner junction edge
assert(myCurrEdge + 1 != myRoute->end());
Expand Down

0 comments on commit 84880fe

Please sign in to comment.