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

Fix incremental unstable rate calculation not matching expectations

The `EventCount` variable wasn't factoring in that some results do not
affect unstable rate. It would therefore become more incorrect as the
play continued.

Closes https://github.com/ppy/osu/issues/31712.
This commit is contained in:
Dean Herbert 2025-01-29 17:06:13 +09:00
parent 6c4b4166ac
commit d8ec3b77e4
No known key found for this signature in database

View File

@ -28,11 +28,12 @@ namespace osu.Game.Rulesets.Scoring
result ??= new UnstableRateCalculationResult(); result ??= new UnstableRateCalculationResult();
// Handle rewinding in the simplest way possible. // Handle rewinding in the simplest way possible.
if (hitEvents.Count < result.EventCount + 1) if (hitEvents.Count < result.LastProcessedIndex + 1)
result = new UnstableRateCalculationResult(); result = new UnstableRateCalculationResult();
for (int i = result.EventCount; i < hitEvents.Count; i++) for (int i = result.LastProcessedIndex + 1; i < hitEvents.Count; i++)
{ {
result.LastProcessedIndex = i;
HitEvent e = hitEvents[i]; HitEvent e = hitEvents[i];
if (!AffectsUnstableRate(e)) if (!AffectsUnstableRate(e))
@ -84,6 +85,11 @@ namespace osu.Game.Rulesets.Scoring
/// </remarks> /// </remarks>
public class UnstableRateCalculationResult public class UnstableRateCalculationResult
{ {
/// <summary>
/// The last result index processed. For internal incremental calculation use.
/// </summary>
public int LastProcessedIndex = -1;
/// <summary> /// <summary>
/// Total events processed. For internal incremental calculation use. /// Total events processed. For internal incremental calculation use.
/// </summary> /// </summary>