recompute parking blackholes after edits

This commit is contained in:
Dustin Carlino 2019-08-23 13:21:45 -07:00
parent f58519d723
commit 5c0fb90819

View File

@ -780,9 +780,21 @@ impl Map {
if !self.pathfinder_dirty {
return;
}
let mut pathfinder = self.pathfinder.take().unwrap();
pathfinder.apply_edits(self, timer);
self.pathfinder = Some(pathfinder);
// Also recompute parking blackholes. This is cheap enough to do from scratch.
timer.start("recompute parking blackholes");
for l in self.lanes.iter_mut() {
l.parking_blackhole = None;
}
for (l, redirect) in make::redirect_parking_blackholes(self, timer) {
self.lanes[l.0].parking_blackhole = Some(redirect);
}
timer.stop("recompute parking blackholes");
self.pathfinder_dirty = false;
}