Skip to content

Commit

Permalink
teleport to first allowed lane ref #14168
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 Dec 21, 2023
1 parent 19cef78 commit f821400
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/microsim/MSVehicleTransfer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ MSVehicleTransfer::checkInsertions(SUMOTime time) {
// let the vehicle move to the next edge
desc.myVeh->leaveLane(MSMoveReminder::NOTIFICATION_TELEPORT_CONTINUATION);
// active move reminders (i.e. rerouters)
desc.myVeh->enterLaneAtMove(desc.myVeh->succEdge(1)->getLanes()[0], true);
const std::vector<MSLane*>* allowedLanes = nextEdge->allowedLanes(vclass);
MSLane* laneToEnter = (allowedLanes != nullptr) ? allowedLanes->at(0) : nextEdge->getLanes()[0];
desc.myVeh->enterLaneAtMove(laneToEnter, true);
// use current travel time to determine when to move the vehicle forward
desc.myProceedTime = time + TIME2STEPS(e->getCurrentTravelTime(TeleportMinSpeed));
}
Expand Down

0 comments on commit f821400

Please sign in to comment.