We do need to fill out trip legs for TripSpec::SpawningFailure; smoke tests in other maps hit it. #258

This commit is contained in:
Dustin Carlino 2020-11-17 18:02:48 -08:00
parent 82c7cd1e8f
commit 739e33ec3e
2 changed files with 5 additions and 2 deletions

View File

@ -612,6 +612,7 @@ impl Pathfinder {
dijkstra::pathfind_avoiding_lanes(req, avoid, map)
}
// TODO Consider returning the walking-only path in the failure case, to avoid wasting work
pub fn should_use_transit(
&self,
map: &Map,

View File

@ -204,8 +204,10 @@ impl TripSpawner {
trips.new_trip(person.id, info, legs)
}
TripSpec::SpawningFailure { .. } => {
// TODO Is it OK to have empty trip legs?
let legs = Vec::new();
// TODO The legs are a lie. Since the trip gets cancelled, this doesn't matter.
// I'm not going to bother doing better because I think TripLeg will get
// revamped soon anyway.
let legs = vec![TripLeg::RideBus(BusRouteID(0), None)];
trips.new_trip(person.id, info, legs)
}
TripSpec::UsingParkedCar { car, goal, .. } => {