mirror of
https://github.com/ppy/osu.git
synced 2026-05-22 05:43:42 +08:00
Fix edge case that estimates sliderbreaks in impossible scenarios (#34544)
* Test theory crafting * Place in more appropriate place * fix a bit better * Move things around * Reduce diff --------- Co-authored-by: StanR <hi@stanr.info>
This commit is contained in:
committed by
GitHub
Unverified
parent
802e559472
commit
fa1fea02dc
@@ -125,6 +125,19 @@ namespace osu.Game.Rulesets.Osu.Difficulty
|
||||
// In classic scores there can't be more misses than a sum of all non-perfect judgements
|
||||
missCount = Math.Min(missCount, totalImperfectHits);
|
||||
|
||||
// Every slider has *at least* 2 combo attributed in classic mechanics.
|
||||
// If they broke on a slider with a tick, then this still works since they would have lost at least 2 combo (the tick and the end)
|
||||
// Using this as a max means a score that loses 1 combo on a map can't possibly have been a slider break.
|
||||
// It must have been a slider end.
|
||||
int maxPossibleSliderBreaks = Math.Min(attributes.SliderCount, (attributes.MaxCombo - score.MaxCombo) / 2);
|
||||
|
||||
int scoreMissCount = score.Statistics.GetValueOrDefault(HitResult.Miss);
|
||||
|
||||
double sliderBreaks = missCount - scoreMissCount;
|
||||
|
||||
if (sliderBreaks > maxPossibleSliderBreaks)
|
||||
missCount = scoreMissCount + maxPossibleSliderBreaks;
|
||||
|
||||
return missCount;
|
||||
}
|
||||
|
||||
|
||||
@@ -343,6 +343,17 @@ namespace osu.Game.Rulesets.Osu.Difficulty
|
||||
|
||||
// In classic scores there can't be more misses than a sum of all non-perfect judgements
|
||||
missCount = Math.Min(missCount, totalImperfectHits);
|
||||
|
||||
// Every slider has *at least* 2 combo attributed in classic mechanics.
|
||||
// If they broke on a slider with a tick, then this still works since they would have lost at least 2 combo (the tick and the end)
|
||||
// Using this as a max means a score that loses 1 combo on a map can't possibly have been a slider break.
|
||||
// It must have been a slider end.
|
||||
int maxPossibleSliderBreaks = Math.Min(attributes.SliderCount, (attributes.MaxCombo - scoreMaxCombo) / 2);
|
||||
|
||||
double sliderBreaks = missCount - countMiss;
|
||||
|
||||
if (sliderBreaks > maxPossibleSliderBreaks)
|
||||
missCount = countMiss + maxPossibleSliderBreaks;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user