Skip to content

Commit

Permalink
extending carriage drawing beyond myFurtherLanes. refs #3907
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Mar 22, 2018
1 parent 69eedb9 commit e536d05
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/guisim/GUIVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,14 @@ GUIVehicle::getPreviousLane(MSLane* current, int& furtherIndex) const {
if (furtherIndex < (int)myFurtherLanes.size()) {
return myFurtherLanes[furtherIndex++];
} else {
int routeIndex = getCurrentRouteEdge() - myRoute->begin();
int backIndex = furtherIndex + 1;
if (routeIndex > backIndex) {
furtherIndex++;
// could also look for the first lane that allows this vehicle class
// but this is probably not an issue for trains
return (*(getCurrentRouteEdge() - backIndex))->getLanes()[0];
}
return current;
}
}
Expand Down

0 comments on commit e536d05

Please sign in to comment.