1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-21 18:07:19 +08:00

Merge pull request #23934 from peppy/fix-score-conversion-failures

Fix score migration not migrating all scores properly
This commit is contained in:
Bartłomiej Dach 2023-06-16 16:16:09 +02:00 committed by GitHub
commit f79c9d711d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -77,8 +77,9 @@ namespace osu.Game.Database
/// 27 2023-06-06 Added EditorTimestamp to BeatmapInfo.
/// 28 2023-06-08 Added IsLegacyScore to ScoreInfo, parsed from replay files.
/// 29 2023-06-12 Run migration of old lazer scores to be best-effort in the new scoring number space. No actual realm changes.
/// 30 2023-06-16 Run migration of old lazer scores again. This time with more correct rounding considerations.
/// </summary>
private const int schema_version = 29;
private const int schema_version = 30;
/// <summary>
/// Lock object which is held during <see cref="BlockAllOperations"/> sections, blocking realm retrieval during blocking periods.
@ -938,6 +939,7 @@ namespace osu.Game.Database
}
case 29:
case 30:
{
var scores = migration.NewRealm
.All<ScoreInfo>()

View File

@ -182,7 +182,7 @@ namespace osu.Game.Database
foreach (var mod in score.Mods)
modMultiplier *= mod.ScoreMultiplier;
return (long)((1000000 * (accuracyPortion * accuracyScore + (1 - accuracyPortion) * comboScore) + bonusScore) * modMultiplier);
return (long)Math.Round((1000000 * (accuracyPortion * accuracyScore + (1 - accuracyPortion) * comboScore) + bonusScore) * modMultiplier);
}
private class FakeHit : HitObject