Skip to content

Commit

Permalink
added test refs #13313, #21
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Jun 2, 2023
1 parent 1267b93 commit 263dfd2
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/microsim/MSVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4887,13 +4887,6 @@ MSVehicle::getBackPositionOnLane(const MSLane* lane, bool calledByGetPosition) c
return myState.myBackPos / myFurtherLanes.back()->getLength() * lane->getLength();
}
} else {
if (lane->getBidiLane() != nullptr) {
if (myLane == lane->getBidiLane()) {
return lane->getLength() - (myState.myPos - myType->getLength());
} else if (myFurtherLanes.size() > 0 && lane->getBidiLane() == myFurtherLanes.back()) {
return lane->getLength() - myState.myBackPos;
}
}
//if (DEBUG_COND) std::cout << SIMTIME << " veh=" << getID() << " myFurtherLanes=" << toString(myFurtherLanes) << "\n";
double leftLength = myType->getLength() - myState.myPos;

Expand All @@ -4904,7 +4897,7 @@ MSVehicle::getBackPositionOnLane(const MSLane* lane, bool calledByGetPosition) c
if (*i == lane) {
return -leftLength;
} else if (*i == lane->getBidiLane()) {
return lane->getLength() + leftLength;
return lane->getLength() + leftLength - (calledByGetPosition ? 2 * myType->getLength() : 0);
}
++i;
}
Expand Down

0 comments on commit 263dfd2

Please sign in to comment.