1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 00:33:21 +08:00

Fix corner case when shuffling.

This commit is contained in:
Huo Yaoyuan 2016-11-07 23:06:14 +08:00
parent 02b903f1ea
commit fd977cacb3

View File

@ -243,7 +243,12 @@ namespace osu.Game.Overlays
play(playHistory[++playHistoryIndex], true);
else
{
if (playList.Count == 0) return;
if (current != null && playList.Count == 1) return;
//shuffle
BeatmapInfo nextToPlay;
do
{
int j = RNG.Next(playListIndex, playList.Count);
if (j != playListIndex)
{
@ -252,8 +257,11 @@ namespace osu.Game.Overlays
playList[j] = temp;
}
BeatmapInfo nextToPlay = playList[playListIndex++].Beatmaps[0];
nextToPlay = playList[playListIndex++].Beatmaps[0];
if (playListIndex == playList.Count) playListIndex = 0;
}
while (current?.BeatmapInfo.AudioEquals(nextToPlay) == true);
play(nextToPlay, true);
appendToHistory(nextToPlay);
}