From 7679d745cbcd4c96d9ca5921063eb6ecd59d78b9 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Wed, 10 May 2023 01:02:12 +0800 Subject: [PATCH] Should always able to get the karaoke ruleset. --- osu.Game.Rulesets.Karaoke/Extensions/OsuGameExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/Extensions/OsuGameExtensions.cs b/osu.Game.Rulesets.Karaoke/Extensions/OsuGameExtensions.cs index 8d2924168..f2b32300e 100644 --- a/osu.Game.Rulesets.Karaoke/Extensions/OsuGameExtensions.cs +++ b/osu.Game.Rulesets.Karaoke/Extensions/OsuGameExtensions.cs @@ -15,10 +15,10 @@ namespace osu.Game.Rulesets.Karaoke.Extensions; /// public static class OsuGameExtensions { - public static KaraokeRuleset? GetRuleset(this DependencyContainer dependencies) + public static KaraokeRuleset GetRuleset(this DependencyContainer dependencies) { var rulesets = dependencies.Get().AvailableRulesets.Select(info => info.CreateInstance()); - return rulesets.FirstOrDefault(r => r is KaraokeRuleset) as KaraokeRuleset; + return rulesets.OfType().First(); } private static Container? getBasePlacementContainer(this OsuGame game)