1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-13 16:13:34 +08:00

Fix IgnoreMiss judgements not updating accuracy

This commit is contained in:
Dan Balasescu 2023-12-13 11:51:45 +09:00
parent 987fe9322e
commit daaadf3fc3
No known key found for this signature in database
2 changed files with 31 additions and 12 deletions

View File

@ -356,6 +356,27 @@ namespace osu.Game.Tests.Rulesets.Scoring
Assert.That(actual, Is.EqualTo(expected).Within(Precision.FLOAT_EPSILON));
}
[TestCase(HitResult.Great)]
[TestCase(HitResult.LargeTickHit)]
public void TestAccuracyUpdateFromIgnoreMiss(HitResult maxResult)
{
scoreProcessor.ApplyBeatmap(new Beatmap
{
HitObjects =
{
new TestHitObject(maxResult, HitResult.IgnoreMiss)
}
});
var judgementResult = new JudgementResult(beatmap.HitObjects.Single(), new TestJudgement(maxResult, HitResult.IgnoreMiss))
{
Type = HitResult.IgnoreMiss
};
scoreProcessor.ApplyResult(judgementResult);
Assert.That(scoreProcessor.Accuracy.Value, Is.Not.EqualTo(1));
}
private class TestJudgement : Judgement
{
public override HitResult MaxResult { get; }

View File

@ -218,9 +218,6 @@ namespace osu.Game.Rulesets.Scoring
scoreResultCounts[result.Type] = scoreResultCounts.GetValueOrDefault(result.Type) + 1;
if (!result.Type.IsScorable())
return;
if (result.Type.IncreasesCombo())
Combo.Value++;
else if (result.Type.BreaksCombo())
@ -228,16 +225,18 @@ namespace osu.Game.Rulesets.Scoring
result.ComboAfterJudgement = Combo.Value;
if (result.Type.AffectsAccuracy())
if (result.Judgement.MaxResult.AffectsAccuracy())
{
currentMaximumBaseScore += Judgement.ToNumericResult(result.Judgement.MaxResult);
currentBaseScore += Judgement.ToNumericResult(result.Type);
currentAccuracyJudgementCount++;
}
if (result.Type.AffectsAccuracy())
currentBaseScore += Judgement.ToNumericResult(result.Type);
if (result.Type.IsBonus())
currentBonusPortion += GetBonusScoreChange(result);
else
else if (result.Type.IsScorable())
currentComboPortion += GetComboScoreChange(result);
ApplyScoreChange(result);
@ -275,19 +274,18 @@ namespace osu.Game.Rulesets.Scoring
scoreResultCounts[result.Type] = scoreResultCounts.GetValueOrDefault(result.Type) - 1;
if (!result.Type.IsScorable())
return;
if (result.Type.AffectsAccuracy())
if (result.Judgement.MaxResult.AffectsAccuracy())
{
currentMaximumBaseScore -= Judgement.ToNumericResult(result.Judgement.MaxResult);
currentBaseScore -= Judgement.ToNumericResult(result.Type);
currentAccuracyJudgementCount--;
}
if (result.Type.AffectsAccuracy())
currentBaseScore -= Judgement.ToNumericResult(result.Type);
if (result.Type.IsBonus())
currentBonusPortion -= GetBonusScoreChange(result);
else
else if (result.Type.IsScorable())
currentComboPortion -= GetComboScoreChange(result);
RemoveScoreChange(result);