Skip to content

Commit

Permalink
avoiding dangerous insertion after teleport. refs #13313
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed May 25, 2023
1 parent 5910cd4 commit 7151fde
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/microsim/MSVehicleTransfer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ MSVehicleTransfer::checkInsertions(SUMOTime time) {
MSLane* l = (nextEdge != nullptr ? e->getFreeLane(e->allowedLanes(*nextEdge, vclass), vclass, departPos) :
e->getFreeLane(nullptr, vclass, departPos));
// handle teleporting vehicles, lane may be 0 because permissions were modified by a closing rerouter or TraCI
if (l != nullptr && l->freeInsertion(*(desc.myVeh), MIN2(l->getSpeedLimit(), desc.myVeh->getMaxSpeed()), 0, MSMoveReminder::NOTIFICATION_TELEPORT)) {
const bool busyBidi = l != nullptr && l->getBidiLane() != nullptr && l->getBidiLane()->getVehicleNumberWithPartials() > 0;
if (l != nullptr && !busyBidi && l->freeInsertion(*(desc.myVeh), MIN2(l->getSpeedLimit(), desc.myVeh->getMaxSpeed()), 0, MSMoveReminder::NOTIFICATION_TELEPORT)) {
if (!desc.myJumping) {
WRITE_WARNINGF(TL("Vehicle '%' ends teleporting on edge '%', time=%."), desc.myVeh->getID(), e->getID(), time2string(time));
}
Expand Down

0 comments on commit 7151fde

Please sign in to comment.