Fix shuffle not actually changing the track sometimes

See https://github.com/ppy/osu/pull/30215#issuecomment-2407775408 for
context.

Turns out the test failures were more correct than I'd thought. The
long-and-short of it is that both in "pure random" mode and in
"permutation" mode, when running out of track history to fall
back on, it was possible for the random algorithm to pick the same song
twice in a row - which is probably not desired, and which this explicit
exclude should make impossible.
This commit is contained in:
Bartłomiej Dach 2024-10-14 13:03:58 +02:00
parent 639eb7ae4a
commit 17aed26f85
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -376,7 +376,7 @@ private bool next(bool allowProtectedTracks)
{
Live<BeatmapSetInfo> result;
var possibleSets = getBeatmapSets().Where(s => !s.Value.Protected || allowProtectedTracks).ToArray();
var possibleSets = getBeatmapSets().Where(s => !s.Value.Equals(current?.BeatmapSetInfo) && (!s.Value.Protected || allowProtectedTracks)).ToArray();
if (possibleSets.Length == 0)
return null;