From 6c1c6a32359e8aca6d22fccad6edbb464138d32a Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Fri, 2 Jul 2021 11:54:59 -0700 Subject: [PATCH] Fix crash when changing speed limit. At some point, we started changing lane IDs for every road edit and never updated this. Closes #685 --- game/src/edit/roads.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/game/src/edit/roads.rs b/game/src/edit/roads.rs index 6b8d96f904..1e1da18068 100644 --- a/game/src/edit/roads.rs +++ b/game/src/edit/roads.rs @@ -262,17 +262,9 @@ impl State for RoadEditor { Outcome::Changed(x) => match x.as_ref() { "speed limit" => { let speed_limit = self.main_panel.dropdown_value("speed limit"); - let mut edits = app.primary.map.get_edits().clone(); - edits - .commands - .push(app.primary.map.edit_road_cmd(self.r, |new| { - new.speed_limit = speed_limit; - })); - apply_map_edits(ctx, app, edits); - self.redo_stack.clear(); - - // Lane IDs don't change - self.recalc_all_panels(ctx, app); + return self.modify_current_lane(ctx, app, Some(0), |new, _| { + new.speed_limit = speed_limit; + }); } "width" => { let width = self.main_panel.dropdown_value("width");