oops, bike starting at border was using a router to car-style park

This commit is contained in:
Dustin Carlino 2018-11-28 13:50:51 -08:00
parent 211019efd2
commit 6bdb28cced
2 changed files with 6 additions and 1 deletions

View File

@ -155,6 +155,7 @@ impl ParkedCar {
vehicle: kinematics::Vehicle,
owner: Option<BuildingID>,
) -> ParkedCar {
assert_eq!(vehicle.vehicle_type, VehicleType::Car);
ParkedCar {
car,
spot,

View File

@ -222,7 +222,11 @@ impl Spawner {
start: Position::new(start, 0.0 * si::M),
router: match goal {
DrivingGoal::ParkNear(b) => {
Router::make_router_to_park(path, *b)
if vehicle.vehicle_type == VehicleType::Bike {
Router::make_bike_router(path, req.end.dist_along())
} else {
Router::make_router_to_park(path, *b)
}
}
DrivingGoal::Border(_, _) => {
Router::make_router_to_border(path)