Skip to content

Commit 7e329d4

Browse files
committed
Add CL for legacy scores if scores have no CL
1 parent 47f1727 commit 7e329d4

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

PerformanceServer/PerformanceController.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using osu.Game.Online.API;
88
using osu.Game.Rulesets;
99
using osu.Game.Rulesets.Difficulty;
10+
using osu.Game.Rulesets.Mods;
1011
using osu.Game.Rulesets.Scoring;
1112
using osu.Game.Scoring;
1213

@@ -39,13 +40,21 @@ public async Task<ActionResult<PerformanceAttributes>> CalculatePerformance(
3940
[FromBody] PerformanceRequestBody body)
4041
{
4142
Ruleset ruleset = Helper.GetRuleset(body.RulesetId);
43+
List<Mod> mods = body.Mods.Select(m => m.ToMod(ruleset)).ToList();
44+
if (body.IsLegacy && !mods.Any(m => m is ModClassic))
45+
{
46+
Mod? classicMod = ruleset.CreateModFromAcronym("CL");
47+
if (classicMod != null)
48+
mods.Add(classicMod);
49+
}
50+
4251
ScoreInfo scoreInfo = new()
4352
{
4453
IsLegacyScore = body.IsLegacy,
4554
Ruleset = new RulesetInfo { OnlineID = body.RulesetId },
4655
BeatmapInfo = new BeatmapInfo { OnlineID = body.BeatmapId },
4756
Statistics = body.Statistics,
48-
Mods = body.Mods.Select(m => m.ToMod(ruleset)).ToArray(),
57+
Mods = mods.ToArray(),
4958
Accuracy = body.Accuracy,
5059
Combo = body.Combo,
5160
};

0 commit comments

Comments
 (0)