mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-24 06:55:40 +03:00
Fix crash in 15m tool. Some of the larger Seattle maps have pedestrian
pathfinding disabled to save space, so make the path calculation optional.
This commit is contained in:
parent
7f71333513
commit
d567366ee2
@ -149,10 +149,9 @@ impl Isochrone {
|
||||
Options::Biking => PathConstraints::Bike,
|
||||
};
|
||||
|
||||
let all_paths = self.start.iter().map(|b_id| {
|
||||
map.pathfind(PathRequest::between_buildings(map, *b_id, to, constraints).unwrap())
|
||||
.ok()
|
||||
.unwrap()
|
||||
let all_paths = self.start.iter().filter_map(|b_id| {
|
||||
PathRequest::between_buildings(map, *b_id, to, constraints)
|
||||
.and_then(|req| map.pathfind(req).ok())
|
||||
});
|
||||
|
||||
all_paths.min_by_key(|path| path.total_length())
|
||||
|
Loading…
Reference in New Issue
Block a user