diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index dc4ec92ee2..a23efcd9d4 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -22,6 +22,8 @@ using osu.Game.Screens.Tournament; using osu.Framework.Input; using OpenTK.Input; using System.Threading.Tasks; +using System.Collections.Generic; +using System.Linq; namespace osu.Game.Screens.Menu { @@ -74,10 +76,10 @@ namespace osu.Game.Screens.Menu if (!menuMusic) { trackManager = game.Audio.Track; - int choosableBeatmapsetAmmount = beatmaps.Query().Count(); - if (choosableBeatmapsetAmmount > 0) + List choosableBeatmapSets = beatmaps.Query().ToList(); + if (choosableBeatmapSets.Count > 0) { - song = beatmaps.GetWorkingBeatmap(beatmaps.GetWithChildren(RNG.Next(1, choosableBeatmapsetAmmount)).Beatmaps[0]); + song = beatmaps.GetWorkingBeatmap(beatmaps.GetWithChildren(choosableBeatmapSets[RNG.Next(0, choosableBeatmapSets.Count - 1)].ID).Beatmaps[0]); Beatmap = song; } }