mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-24 23:15:24 +03:00
Fix a crash where you edit one lane normally, then add/delete lanes of the same road. #597
This commit is contained in:
parent
711d144323
commit
169d3765dd
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user