mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Fix corner case when shuffling.
This commit is contained in:
parent
02b903f1ea
commit
fd977cacb3
@ -243,17 +243,25 @@ namespace osu.Game.Overlays
|
|||||||
play(playHistory[++playHistoryIndex], true);
|
play(playHistory[++playHistoryIndex], true);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (playList.Count == 0) return;
|
||||||
|
if (current != null && playList.Count == 1) return;
|
||||||
//shuffle
|
//shuffle
|
||||||
int j = RNG.Next(playListIndex, playList.Count);
|
BeatmapInfo nextToPlay;
|
||||||
if (j != playListIndex)
|
do
|
||||||
{
|
{
|
||||||
BeatmapSetInfo temp = playList[playListIndex];
|
int j = RNG.Next(playListIndex, playList.Count);
|
||||||
playList[playListIndex] = playList[j];
|
if (j != playListIndex)
|
||||||
playList[j] = temp;
|
{
|
||||||
}
|
BeatmapSetInfo temp = playList[playListIndex];
|
||||||
|
playList[playListIndex] = playList[j];
|
||||||
|
playList[j] = temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
nextToPlay = playList[playListIndex++].Beatmaps[0];
|
||||||
|
if (playListIndex == playList.Count) playListIndex = 0;
|
||||||
|
}
|
||||||
|
while (current?.BeatmapInfo.AudioEquals(nextToPlay) == true);
|
||||||
|
|
||||||
BeatmapInfo nextToPlay = playList[playListIndex++].Beatmaps[0];
|
|
||||||
if (playListIndex == playList.Count) playListIndex = 0;
|
|
||||||
play(nextToPlay, true);
|
play(nextToPlay, true);
|
||||||
appendToHistory(nextToPlay);
|
appendToHistory(nextToPlay);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user