Skip to content

Commit

Permalink
Fix thing
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Jun 14, 2023
1 parent 1e8177f commit fbcb684
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions osu.Game/Database/RealmAccess.cs
Expand Up @@ -945,22 +945,26 @@ private void applyMigrationsForVersion(Migration migration, ulong targetVersion)

foreach (var score in scores)
{
// Recalculate the old-style standardised score to see if this was an old lazer score.
bool oldScoreMatchesExpectations = StandardisedScoreMigrationTools.GetOldStandardised(score) == score.TotalScore;
// Some older scores don't have correct statistics populated, so let's give them benefit of doubt.
bool scoreIsVeryOld = score.Date < new DateTime(2023, 1, 1, 0, 0, 0);

if (oldScoreMatchesExpectations || scoreIsVeryOld)
try
{
try
{
long calculatedNew = StandardisedScoreMigrationTools.GetNewStandardised(score);
score.TotalScore = calculatedNew;
}
catch
// Recalculate the old-style standardised score to see if this was an old lazer score.
bool oldScoreMatchesExpectations = StandardisedScoreMigrationTools.GetOldStandardised(score) == score.TotalScore;
// Some older scores don't have correct statistics populated, so let's give them benefit of doubt.
bool scoreIsVeryOld = score.Date < new DateTime(2023, 1, 1, 0, 0, 0);

if (oldScoreMatchesExpectations || scoreIsVeryOld)
{
try
{
long calculatedNew = StandardisedScoreMigrationTools.GetNewStandardised(score);
score.TotalScore = calculatedNew;
}
catch
{
}
}
}
catch { }
}

break;
Expand Down

0 comments on commit fbcb684

Please sign in to comment.