1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-27 10:23:03 +08:00

Fix incorrect nesting of statements causing completely broken logic

This commit is contained in:
Dean Herbert 2022-01-23 17:51:32 +09:00
parent 33d3a10708
commit a5493ce0d1

View File

@ -99,18 +99,19 @@ namespace osu.Game.Screens.Menu
{
realmContextFactory.Run(realm =>
{
var sets = realm.All<BeatmapSetInfo>().Where(s => !s.DeletePending && !s.Protected).AsRealmCollection();
var usableBeatmapSets = realm.All<BeatmapSetInfo>().Where(s => !s.DeletePending && !s.Protected).AsRealmCollection();
int setCount = sets.Count;
int setCount = usableBeatmapSets.Count;
if (setCount > 0)
{
var found = sets[RNG.Next(0, setCount - 1)].Beatmaps.FirstOrDefault();
var found = usableBeatmapSets[RNG.Next(0, setCount - 1)].Beatmaps.FirstOrDefault();
if (found != null)
initialBeatmap = beatmaps.GetWorkingBeatmap(found);
}
});
}
// we generally want a song to be playing on startup, so use the intro music even if a user has specified not to if no other track is available.
if (initialBeatmap == null)
@ -145,7 +146,6 @@ namespace osu.Game.Screens.Menu
return UsingThemedIntro = initialBeatmap != null;
}
}
}
public override void OnResuming(IScreen last)
{