diff --git a/src/microsim/MSVehicle.cpp b/src/microsim/MSVehicle.cpp index f9a4bf0b7024..36dac96856a9 100644 --- a/src/microsim/MSVehicle.cpp +++ b/src/microsim/MSVehicle.cpp @@ -5367,6 +5367,20 @@ MSVehicle::updateBestLanes(bool forceRebuild, const MSLane* startLane) { } } + // bikes ought to consider bike paths the best lanes in any case + if (myType->getVehicleClass() == SVC_BICYCLE) { + for (std::vector::iterator j = clanes.begin(); j != clanes.end(); ++j) { + if (isBikepath(j->lane->getPermissions()) && j->allowsContinuation) { + bestThisIndex = j - clanes.begin(); + for (std::vector::iterator l = clanes.begin(); l != clanes.end(); ++l) { + (*l).bestLaneOffset = j - l; + (*l).length = bestLength; + } + break; + } + } + } + } else { // only needed in case of disconnected routes int bestNextIndex = 0;