mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-24 23:15:24 +03:00
Fix loading edits that change the number of lanes in a road. We need to compare the old version of the road in the edits with the basemap, NOT the edited version of the road. #597
This commit is contained in:
parent
d8cdfaba05
commit
ae3d4e2363
@ -95,12 +95,12 @@ impl PermanentEditCmd {
|
||||
let num_current = map.get_r(id).lanes_ltr().len();
|
||||
// The basemap changed -- it'd be pretty hard to understand the original
|
||||
// intent of the edit.
|
||||
if num_current != new.lanes_ltr.len() {
|
||||
if num_current != old.lanes_ltr.len() {
|
||||
bail!(
|
||||
"number of lanes in {} is {} now, but {} in the edits",
|
||||
r,
|
||||
num_current,
|
||||
new.lanes_ltr.len()
|
||||
old.lanes_ltr.len()
|
||||
);
|
||||
}
|
||||
Ok(EditCmd::ChangeRoad { r: id, new, old })
|
||||
|
Loading…
Reference in New Issue
Block a user