Merge pull request #30424 from bdach/wtf-wtf-wtf-wtf

Do not fall back to beatmap's original ruleset if conversion fails
This commit is contained in:
Dan Balasescu 2024-10-28 17:14:19 +09:00 committed by GitHub
commit 904b76b9d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 5 deletions

View File

@ -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 } });

View File

@ -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)