mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-24 15:02:59 +03:00
Fix crash when changing speed limit. At some point, we started changing lane IDs for every road edit and never updated this. Closes #685
This commit is contained in:
parent
4fd86c8a41
commit
6c1c6a3235
@ -262,17 +262,9 @@ impl State<App> 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");
|
||||
|
Loading…
Reference in New Issue
Block a user