From ed0ca15aeff5a893796d78fa0219bec9e3fbd285 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Wed, 21 Aug 2019 14:40:29 -0700 Subject: [PATCH] make sim layer use parking redirects. lots of aborted trips now fixed! --- editor/src/common/warp.rs | 4 +++- map_model/src/map.rs | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/editor/src/common/warp.rs b/editor/src/common/warp.rs index b44f987f48..b044486a8b 100644 --- a/editor/src/common/warp.rs +++ b/editor/src/common/warp.rs @@ -7,6 +7,8 @@ use map_model::{raw_data, AreaID, BuildingID, IntersectionID, LaneID, RoadID}; use sim::{PedestrianID, TripID}; use std::usize; +const WARP_TO_CAM_ZOOM: f64 = 10.0; + pub struct EnteringWarp; impl EnteringWarp { pub fn new() -> Box { @@ -20,7 +22,7 @@ fn warp_to(wiz: &mut Wizard, ctx: &mut EventCtx, ui: &mut UI) -> Option LaneID { if let Ok(l) = self.find_closest_lane_to_bldg(b, vec![LaneType::Driving]) { - return l; + return self.get_l(l).parking_blackhole.unwrap_or(l); } let mut roads_queue: VecDeque = VecDeque::new(); @@ -579,7 +581,7 @@ impl Map { .chain(r.children_backwards.iter()) { if *lane_type == LaneType::Driving { - return *lane; + return self.get_l(*lane).parking_blackhole.unwrap_or(*lane); } }