Editing modes: fixed some crashes related to undoing/redoing while objects with associations were highlighted

This commit is contained in:
biwa 2020-10-09 18:53:10 +02:00 committed by spherallic
parent 76e68f6c9a
commit 60a010efd1
3 changed files with 24 additions and 0 deletions

View file

@ -938,6 +938,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Map.Map.ConvertSelection(SelectionType.Linedefs);
}
// If something is highlighted make sure to update the association so that it contains valid data
if (highlighted != null && !highlighted.IsDisposed)
highlightasso.Set(highlighted);
// Update selection info and labels
UpdateSelectionInfo();
SetupSectorLabels();
@ -955,6 +959,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Map.Map.ConvertSelection(SelectionType.Linedefs);
}
// If something is highlighted make sure to update the association so that it contains valid data
if (highlighted != null && !highlighted.IsDisposed)
highlightasso.Set(highlighted);
// Update selection info and labels
UpdateSelectionInfo();
SetupSectorLabels();

View file

@ -1502,6 +1502,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Map.Map.ConvertSelection(SelectionType.Sectors);
}
// If something is highlighted make sure to update the association so that it contains valid data
if (highlighted != null && !highlighted.IsDisposed)
highlightasso.Set(highlighted);
// Clear labels
SetupLabels();
UpdateEffectLabels(); //mxd
@ -1531,6 +1535,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Map.Map.ConvertSelection(SelectionType.Sectors);
}
// If something is highlighted make sure to update the association so that it contains valid data
if (highlighted != null && !highlighted.IsDisposed)
highlightasso.Set(highlighted);
// Clear labels
SetupLabels();
UpdateEffectLabels(); //mxd

View file

@ -570,6 +570,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Map.Map.SelectMarkedGeometry(true, true);
}
// If something is highlighted make sure to update the association so that it contains valid data
if (highlighted != null && !highlighted.IsDisposed)
highlightasso.Set(highlighted);
UpdateSelectionInfo(); // Update selection info and labels
UpdateHelperObjects(); // Update helper lines
SetupSectorLabels(); // And sector labels
@ -586,6 +590,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Map.Map.SelectMarkedGeometry(true, true);
}
// If something is highlighted make sure to update the association so that it contains valid data
if (highlighted != null && !highlighted.IsDisposed)
highlightasso.Set(highlighted);
UpdateSelectionInfo(); // Update selection info and labels
UpdateHelperObjects(); // Update helper lines
SetupSectorLabels(); // And sector labels