Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect maximum accuracy display with recent slider end changes #25492

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions osu.Game.Tests/Rulesets/Scoring/ScoreProcessorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,30 @@ public void TestLegacyComboIncrease()
}
#pragma warning restore CS0618

[Test]
public void TestMaxAccuracyOnIgnoreMiss()
{
beatmap = new TestBeatmap(new RulesetInfo())
{
HitObjects = new List<HitObject>
{
new TestHitObject(HitResult.Great),
new TestHitObject(HitResult.LargeTickHit, HitResult.IgnoreMiss),
}
};

scoreProcessor = new TestScoreProcessor();
scoreProcessor.ApplyBeatmap(beatmap);

scoreProcessor.ApplyResult(new JudgementResult(beatmap.HitObjects[0], beatmap.HitObjects[0].CreateJudgement()) { Type = HitResult.Miss });
Assert.That(scoreProcessor.Combo.Value, Is.EqualTo(0));
Assert.That(scoreProcessor.Accuracy.Value, Is.EqualTo(0));

scoreProcessor.ApplyResult(new JudgementResult(beatmap.HitObjects[1], beatmap.HitObjects[1].CreateJudgement()) { Type = HitResult.IgnoreMiss });
Assert.That(scoreProcessor.Accuracy.Value, Is.EqualTo(0));
Assert.That(scoreProcessor.MaximumAccuracy.Value, Is.EqualTo(0));
}

[Test]
public void TestComboBreak()
{
Expand Down
36 changes: 19 additions & 17 deletions osu.Game/Rulesets/Scoring/ScoreProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ public override void ApplyBeatmap(IBeatmap beatmap)

protected sealed override void ApplyResultInternal(JudgementResult result)
{
HitResult maxResult = result.Judgement.MaxResult;

result.ComboAtJudgement = Combo.Value;
result.HighestComboAtJudgement = HighestCombo.Value;

Expand All @@ -210,29 +212,29 @@ protected sealed override void ApplyResultInternal(JudgementResult result)

scoreResultCounts[result.Type] = scoreResultCounts.GetValueOrDefault(result.Type) + 1;

if (!result.Type.IsScorable())
return;

if (result.Type.IncreasesCombo())
Combo.Value++;
else if (result.Type.BreaksCombo())
Combo.Value = 0;

result.ComboAfterJudgement = Combo.Value;

if (result.Type.AffectsAccuracy())
if (maxResult.AffectsAccuracy())
{
currentMaximumBaseScore += Judgement.ToNumericResult(result.Judgement.MaxResult);
currentMaximumBaseScore += Judgement.ToNumericResult(maxResult);
currentBaseScore += Judgement.ToNumericResult(result.Type);
currentAccuracyJudgementCount++;
}

if (result.Type.IsBonus())
currentBonusPortion += GetBonusScoreChange(result);
else
currentComboPortion += GetComboScoreChange(result);
if (!result.Type.IsScorable())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this condition reversed, or am I misunderstanding this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'm a bit confused how this happened. It should be inverse (I likely broke this in refactoring after actually testing this PR).

{
if (result.Type.IncreasesCombo())
Combo.Value++;
else if (result.Type.BreaksCombo())
Combo.Value = 0;

ApplyScoreChange(result);
result.ComboAfterJudgement = Combo.Value;

if (result.Type.IsBonus())
currentBonusPortion += GetBonusScoreChange(result);
else
currentComboPortion += GetComboScoreChange(result);

ApplyScoreChange(result);
}

if (!IsSimulating)
{
Expand Down
4 changes: 2 additions & 2 deletions osu.Game/Screens/Play/HUD/GameplayAccuracyCounter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ protected override void LoadComplete()
{
base.LoadComplete();

AccuracyDisplay.BindValueChanged(mod =>
AccuracyDisplay.BindValueChanged(mode =>
{
Current.UnbindBindings();

switch (mod.NewValue)
switch (mode.NewValue)
{
case AccuracyDisplayMode.Standard:
Current.BindTo(scoreProcessor.Accuracy);
Expand Down
Loading