diff --git a/editor/src/plugins/follow.rs b/editor/src/plugins/follow.rs index c7fab628ee..e14e3748da 100644 --- a/editor/src/plugins/follow.rs +++ b/editor/src/plugins/follow.rs @@ -21,6 +21,8 @@ impl FollowState { let quit = match self { FollowState::Empty => false, // TODO be generic and take an AgentID + // TODO when an agent disappears, they sometimes become a car/ped -- follow them + // instead FollowState::FollowingCar(id) => { if let Some(c) = sim.get_draw_car(*id, map) { let pt = c.focus_pt(); diff --git a/sim/src/driving.rs b/sim/src/driving.rs index 20b07d2e37..29195bd517 100644 --- a/sim/src/driving.rs +++ b/sim/src/driving.rs @@ -69,7 +69,7 @@ impl Car { fn react( &self, // The high-level plan might change here. - router: &mut Router, + orig_router: &mut Router, rng: &mut R, map: &Map, time: Tick, @@ -86,7 +86,7 @@ impl Car { let vehicle = &properties[&self.id]; - if let Some(act) = router.react_before_lookahead( + if let Some(act) = orig_router.react_before_lookahead( &view.cars[&self.id], vehicle, time, @@ -106,7 +106,7 @@ impl Car { let mut requests: Vec = Vec::new(); let mut current_on = self.on; let mut current_dist_along = self.dist_along; - let mut current_router = router.clone(); + let mut current_router = orig_router.clone(); let mut dist_scanned_ahead = 0.0 * si::M; loop { @@ -161,7 +161,7 @@ impl Car { // Stop for something? if let On::Lane(id) = current_on { - let maybe_stop_early = router.stop_early_at_dist( + let maybe_stop_early = current_router.stop_early_at_dist( current_on, current_dist_along, vehicle,