mirror of
https://github.com/osukey/osukey.git
synced 2025-06-09 21:37:59 +09:00
Fix incorrect nesting of statements causing completely broken logic
This commit is contained in:
parent
33d3a10708
commit
a5493ce0d1
@ -99,18 +99,19 @@ namespace osu.Game.Screens.Menu
|
|||||||
{
|
{
|
||||||
realmContextFactory.Run(realm =>
|
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)
|
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)
|
if (found != null)
|
||||||
initialBeatmap = beatmaps.GetWorkingBeatmap(found);
|
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.
|
// 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)
|
if (initialBeatmap == null)
|
||||||
@ -145,7 +146,6 @@ namespace osu.Game.Screens.Menu
|
|||||||
return UsingThemedIntro = initialBeatmap != null;
|
return UsingThemedIntro = initialBeatmap != null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnResuming(IScreen last)
|
public override void OnResuming(IScreen last)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user