mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-25 07:25:47 +03:00
We do need to fill out trip legs for TripSpec::SpawningFailure; smoke tests in other maps hit it. #258
This commit is contained in:
parent
82c7cd1e8f
commit
739e33ec3e
@ -612,6 +612,7 @@ impl Pathfinder {
|
|||||||
dijkstra::pathfind_avoiding_lanes(req, avoid, map)
|
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(
|
pub fn should_use_transit(
|
||||||
&self,
|
&self,
|
||||||
map: &Map,
|
map: &Map,
|
||||||
|
@ -204,8 +204,10 @@ impl TripSpawner {
|
|||||||
trips.new_trip(person.id, info, legs)
|
trips.new_trip(person.id, info, legs)
|
||||||
}
|
}
|
||||||
TripSpec::SpawningFailure { .. } => {
|
TripSpec::SpawningFailure { .. } => {
|
||||||
// TODO Is it OK to have empty trip legs?
|
// TODO The legs are a lie. Since the trip gets cancelled, this doesn't matter.
|
||||||
let legs = Vec::new();
|
// 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)
|
trips.new_trip(person.id, info, legs)
|
||||||
}
|
}
|
||||||
TripSpec::UsingParkedCar { car, goal, .. } => {
|
TripSpec::UsingParkedCar { car, goal, .. } => {
|
||||||
|
Loading…
Reference in New Issue
Block a user