1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 22:53:22 +08:00

Fix failed scores with no hits on beatmaps with ridiculous mod combinations showing hundreds of pp points awarded (#31741)

See
https://discord.com/channels/188630481301012481/1097318920991559880/1334716356582572074.

On `master` this is actually worse and shows thousands of pp points, so
I guess `pp-dev` is a comparable improvement, but still flagrantly
wrong. The reason why `pp-dev` is better is the `speedDeviation == null`
guard at the start of `computeSpeedValue()` which turns off the rest of
the calculation, therefore not exposing the bug where
`relevantTotalDiff` can go negative. I still guarded it in this commit
just for safety's sake given it is clear it can do very wrong stuff.
This commit is contained in:
Bartłomiej Dach 2025-02-14 15:52:05 +01:00 committed by GitHub
parent afdcf40d7e
commit 4e66536ae8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -273,7 +273,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty
speedValue *= speedHighDeviationMultiplier;
// Calculate accuracy assuming the worst case scenario
double relevantTotalDiff = totalHits - attributes.SpeedNoteCount;
double relevantTotalDiff = Math.Max(0, totalHits - attributes.SpeedNoteCount);
double relevantCountGreat = Math.Max(0, countGreat - relevantTotalDiff);
double relevantCountOk = Math.Max(0, countOk - Math.Max(0, relevantTotalDiff - countGreat));
double relevantCountMeh = Math.Max(0, countMeh - Math.Max(0, relevantTotalDiff - countGreat - countOk));
@ -297,7 +297,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty
amountHitObjectsWithAccuracy += attributes.SliderCount;
if (amountHitObjectsWithAccuracy > 0)
betterAccuracyPercentage = ((countGreat - (totalHits - amountHitObjectsWithAccuracy)) * 6 + countOk * 2 + countMeh) / (double)(amountHitObjectsWithAccuracy * 6);
betterAccuracyPercentage = ((countGreat - Math.Max(totalHits - amountHitObjectsWithAccuracy, 0)) * 6 + countOk * 2 + countMeh) / (double)(amountHitObjectsWithAccuracy * 6);
else
betterAccuracyPercentage = 0;