mirror of
https://github.com/ppy/osu.git
synced 2026-06-06 17:16:12 +08:00
Fix undoing bookmark operations potentially making them unsorted
Found in testing of previous commit. This would break seeking between bookmarks. Reproduction steps on `master`: - open map with bookmark - delete the first bookmark - undo the deletion of the first bookmark - seek to previous bookmark will now always seek to the first bookmark rather than closest preceding regardless of current clock time
This commit is contained in:
@@ -115,7 +115,9 @@ namespace osu.Game.Screens.Edit
|
||||
if (editorBeatmap.Bookmarks.Contains(newBookmark))
|
||||
continue;
|
||||
|
||||
editorBeatmap.Bookmarks.Add(newBookmark);
|
||||
int idx = editorBeatmap.Bookmarks.BinarySearch(newBookmark);
|
||||
if (idx < 0)
|
||||
editorBeatmap.Bookmarks.Insert(~idx, newBookmark);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user