mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 13:03:21 +08:00
Move transferal of LegacyTotalScore
back to original spot
This subtle detail was messing with server-side score import flows. Server-side, legacy total score will *already* be in `LegacyTotalScore` from the start, and `TotalScore` will be zero until recomputed via `StandardisedScoreMigrationTools.UpdateFromLegacy()` - so in that context, attempting to move it across is incorrect.
This commit is contained in:
parent
0cf90677e6
commit
cb87d6ce50
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
@ -316,12 +317,11 @@ namespace osu.Game.Database
|
|||||||
if (!score.IsLegacyScore)
|
if (!score.IsLegacyScore)
|
||||||
return score.TotalScore;
|
return score.TotalScore;
|
||||||
|
|
||||||
|
Debug.Assert(score.LegacyTotalScore != null);
|
||||||
|
|
||||||
if (ruleset is not ILegacyRuleset legacyRuleset)
|
if (ruleset is not ILegacyRuleset legacyRuleset)
|
||||||
return score.TotalScore;
|
return score.TotalScore;
|
||||||
|
|
||||||
// ensure legacy total score is saved for later.
|
|
||||||
score.LegacyTotalScore = score.TotalScore;
|
|
||||||
|
|
||||||
double legacyModMultiplier = legacyRuleset.CreateLegacyScoreSimulator().GetLegacyScoreMultiplier(score.Mods, difficulty);
|
double legacyModMultiplier = legacyRuleset.CreateLegacyScoreSimulator().GetLegacyScoreMultiplier(score.Mods, difficulty);
|
||||||
int maximumLegacyAccuracyScore = attributes.AccuracyScore;
|
int maximumLegacyAccuracyScore = attributes.AccuracyScore;
|
||||||
long maximumLegacyComboScore = (long)Math.Round(attributes.ComboScore * legacyModMultiplier);
|
long maximumLegacyComboScore = (long)Math.Round(attributes.ComboScore * legacyModMultiplier);
|
||||||
|
@ -134,6 +134,10 @@ namespace osu.Game.Scoring.Legacy
|
|||||||
}
|
}
|
||||||
|
|
||||||
PopulateMaximumStatistics(score.ScoreInfo, workingBeatmap);
|
PopulateMaximumStatistics(score.ScoreInfo, workingBeatmap);
|
||||||
|
|
||||||
|
if (score.ScoreInfo.IsLegacyScore)
|
||||||
|
score.ScoreInfo.LegacyTotalScore = score.ScoreInfo.TotalScore;
|
||||||
|
|
||||||
StandardisedScoreMigrationTools.UpdateFromLegacy(score.ScoreInfo, workingBeatmap);
|
StandardisedScoreMigrationTools.UpdateFromLegacy(score.ScoreInfo, workingBeatmap);
|
||||||
|
|
||||||
// before returning for database import, we must restore the database-sourced BeatmapInfo.
|
// before returning for database import, we must restore the database-sourced BeatmapInfo.
|
||||||
|
Loading…
Reference in New Issue
Block a user