mirror of
https://github.com/ppy/osu
synced 2024-12-16 03:45:46 +00:00
Merge pull request #25740 from smoogipoo/fix-ignoremiss-accuracy-update
Fix IgnoreMiss judgements not updating accuracy
This commit is contained in:
commit
aa4faf5e8e
@ -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; }
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user