mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-24 01:15:12 +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() {
|
Outcome::Changed(x) => match x.as_ref() {
|
||||||
"speed limit" => {
|
"speed limit" => {
|
||||||
let speed_limit = self.main_panel.dropdown_value("speed limit");
|
let speed_limit = self.main_panel.dropdown_value("speed limit");
|
||||||
let mut edits = app.primary.map.get_edits().clone();
|
return self.modify_current_lane(ctx, app, Some(0), |new, _| {
|
||||||
edits
|
new.speed_limit = speed_limit;
|
||||||
.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);
|
|
||||||
}
|
}
|
||||||
"width" => {
|
"width" => {
|
||||||
let width = self.main_panel.dropdown_value("width");
|
let width = self.main_panel.dropdown_value("width");
|
||||||
|
Loading…
Reference in New Issue
Block a user