1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Merge pull request #26127 from ntransw/fix-rewind-backtracking

Fix rewind incorrectly selecting the same beatmap
This commit is contained in:
Bartłomiej Dach 2023-12-26 12:56:56 +01:00 committed by GitHub
commit 4077d3a259
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 1 deletions

View File

@ -454,6 +454,23 @@ namespace osu.Game.Tests.Visual.SongSelect
AddStep("Un-filter", () => carousel.Filter(new FilterCriteria(), false));
}
[Test]
public void TestRewind()
{
const int local_set_count = 3;
const int random_select_count = local_set_count * 3;
loadBeatmaps(setCount: local_set_count);
for (int i = 0; i < random_select_count; i++)
nextRandom();
for (int i = 0; i < random_select_count; i++)
{
prevRandom();
AddAssert("correct random last selected", () => selectedSets.Peek(), () => Is.EqualTo(carousel.SelectedBeatmapSet));
}
}
[Test]
public void TestRewindToDeletedBeatmap()
{

View File

@ -643,7 +643,7 @@ namespace osu.Game.Screens.Select
while (randomSelectedBeatmaps.Any())
{
var beatmap = randomSelectedBeatmaps[^1];
randomSelectedBeatmaps.Remove(beatmap);
randomSelectedBeatmaps.RemoveAt(randomSelectedBeatmaps.Count - 1);
if (!beatmap.Filtered.Value && beatmap.BeatmapInfo.BeatmapSet?.DeletePending != true)
{