Merge pull request #25740 from smoogipoo/fix-ignoremiss-accuracy-update

Fix IgnoreMiss judgements not updating accuracy
This commit is contained in:
Dean Herbert 2023-12-13 15:03:07 +09:00 committed by GitHub
commit aa4faf5e8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 14 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);

View File

@ -23,11 +23,11 @@ namespace osu.Game.Screens.Play.HUD
{
base.LoadComplete();
AccuracyDisplay.BindValueChanged(mod =>
AccuracyDisplay.BindValueChanged(mode =>
{
Current.UnbindBindings();
switch (mod.NewValue)
switch (mode.NewValue)
{
case AccuracyDisplayMode.Standard:
Current.BindTo(scoreProcessor.Accuracy);