Skip to content

Commit

Permalink
Merge pull request ppy#30424 from bdach/wtf-wtf-wtf-wtf
Browse files Browse the repository at this point in the history
Do not fall back to beatmap's original ruleset if conversion fails
  • Loading branch information
smoogipoo authored Oct 28, 2024
2 parents 09582aa + 0b3d906 commit 904b76b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions osu.Game.Rulesets.Taiko.Tests/Judgements/JudgementTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ protected void PerformTest(List<ReplayFrame> frames, Beatmap<TaikoHitObject>? be
AddStep("load player", () =>
{
Beatmap.Value = CreateWorkingBeatmap(beatmap);
Ruleset.Value = new TaikoRuleset().RulesetInfo;
SelectedMods.Value = mods ?? Array.Empty<Mod>();
var p = new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } });
Expand Down
7 changes: 2 additions & 5 deletions osu.Game/Screens/Play/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -562,11 +562,8 @@ private IBeatmap loadPlayableBeatmap(Mod[] gameplayMods, CancellationToken cance
}
catch (BeatmapInvalidForRulesetException)
{
// A playable beatmap may not be creatable with the user's preferred ruleset, so try using the beatmap's default ruleset
rulesetInfo = Beatmap.Value.BeatmapInfo.Ruleset;
ruleset = rulesetInfo.CreateInstance();

playable = Beatmap.Value.GetPlayableBeatmap(rulesetInfo, gameplayMods, cancellationToken);
Logger.Log($"The current beatmap is not playable in {ruleset.RulesetInfo.Name}!", level: LogLevel.Important);
return null;
}

if (playable.HitObjects.Count == 0)
Expand Down

0 comments on commit 904b76b

Please sign in to comment.