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;
double legacyAccScore = maximumLegacyAccuracyScore * score.Accuracy;
// 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
// 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.
double comboProportion = maximumLegacyComboScore + maximumLegacyBonusScore > 0
? Math.Max((double)score.LegacyTotalScore - legacyAccScore, 0) / (maximumLegacyComboScore + maximumLegacyBonusScore)
: 0;
double comboProportion;
if (maximumLegacyComboScore + maximumLegacyBonusScore > 0)
{
// We can not separate the ComboScore from the BonusScore, so we keep the bonus in the ratio.
comboProportion = Math.Max((double)score.LegacyTotalScore - legacyAccScore, 0) / (maximumLegacyComboScore + maximumLegacyBonusScore);
}
else
{
// Two possible causes:
// 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.
long maximumLegacyBaseScore = maximumLegacyAccuracyScore + maximumLegacyComboScore;