mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Fix undo/redo behaving poorly with simultaneous objects
This commit is contained in:
@ -63,8 +63,10 @@ namespace osu.Game.Screens.Edit
|
||||
}
|
||||
}
|
||||
|
||||
// Make the removal indices are sorted so that iteration order doesn't get messed up post-removal.
|
||||
// Sort the indices to ensure that removal + insertion indices don't get jumbled up post-removal or post-insertion.
|
||||
// This isn't strictly required, but the differ makes no guarantees about order.
|
||||
toRemove.Sort();
|
||||
toAdd.Sort();
|
||||
|
||||
// Apply the changes.
|
||||
for (int i = toRemove.Count - 1; i >= 0; i--)
|
||||
@ -74,7 +76,7 @@ namespace osu.Game.Screens.Edit
|
||||
{
|
||||
IBeatmap newBeatmap = readBeatmap(newState);
|
||||
foreach (var i in toAdd)
|
||||
editorBeatmap.Add(newBeatmap.HitObjects[i]);
|
||||
editorBeatmap.Insert(i, newBeatmap.HitObjects[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user