1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 13:22:55 +08:00

Merge pull request #26440 from bdach/incorrect-combo-proportion

Fix score conversion incorrectly assuming zero combo score in certain cases
This commit is contained in:
Dean Herbert 2024-01-09 13:21:30 +09:00 committed by GitHub
commit 743411d7c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -311,13 +311,22 @@ namespace osu.Game.Database
long maximumLegacyBonusScore = attributes.BonusScore; long maximumLegacyBonusScore = attributes.BonusScore;
double legacyAccScore = maximumLegacyAccuracyScore * score.Accuracy; double legacyAccScore = maximumLegacyAccuracyScore * score.Accuracy;
double comboProportion;
if (maximumLegacyComboScore + maximumLegacyBonusScore > 0)
{
// We can not separate the ComboScore from the BonusScore, so we keep the bonus in the ratio. // We can not separate the ComboScore from the BonusScore, so we keep the bonus in the ratio.
// Note that `maximumLegacyComboScore + maximumLegacyBonusScore` can actually be 0 comboProportion = Math.Max((double)score.LegacyTotalScore - legacyAccScore, 0) / (maximumLegacyComboScore + maximumLegacyBonusScore);
// when playing a beatmap with no bonus objects, with mods that have a 0.0x multiplier on stable (relax/autopilot). }
// In such cases, just assume 0. else
double comboProportion = maximumLegacyComboScore + maximumLegacyBonusScore > 0 {
? Math.Max((double)score.LegacyTotalScore - legacyAccScore, 0) / (maximumLegacyComboScore + maximumLegacyBonusScore) // Two possible causes:
: 0; // the beatmap has no bonus objects *AND*
// either the active mods have a zero mod multiplier, in which case assume 0,
// or the *beatmap* has a zero `difficultyPeppyStars` (or just no combo-giving objects), in which case assume 1.
comboProportion = legacyModMultiplier == 0 ? 0 : 1;
}
// We assume the bonus proportion only makes up the rest of the score that exceeds maximumLegacyBaseScore. // We assume the bonus proportion only makes up the rest of the score that exceeds maximumLegacyBaseScore.
long maximumLegacyBaseScore = maximumLegacyAccuracyScore + maximumLegacyComboScore; long maximumLegacyBaseScore = maximumLegacyAccuracyScore + maximumLegacyComboScore;