Fix a crash where you edit one lane normally, then add/delete lanes of the same road. #597

This commit is contained in:
Dustin Carlino 2021-04-09 14:39:30 -07:00
parent 711d144323
commit 169d3765dd

View File

@ -447,6 +447,12 @@ impl DrawMap {
}
pub fn create_lane(&mut self, l: LaneID, map: &Map) {
// If we're recreating an existing lane, don't create a duplicate quadtree entry for it!
// quadtree.insert_with_box isn't idempotent.
if let Some(item_id) = self.lane_ids.remove(&l) {
self.quadtree.remove(item_id).unwrap();
}
let draw = DrawLane::new(map.get_l(l), map);
let item_id = self
.quadtree