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 combo starting at 0 when spectating #18584

Merged
merged 2 commits into from Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions osu.Game.Tests/Gameplay/TestSceneScoreProcessor.cs
Expand Up @@ -59,12 +59,14 @@ public void TestResetFromReplayFrame()
scoreProcessor.ApplyResult(new JudgementResult(beatmap.HitObjects[0], new TestJudgement(HitResult.Great)) { Type = HitResult.Great });
Assert.That(scoreProcessor.TotalScore.Value, Is.EqualTo(1_000_000));
Assert.That(scoreProcessor.JudgedHits, Is.EqualTo(1));
Assert.That(scoreProcessor.Combo.Value, Is.EqualTo(1));

// No header shouldn't cause any change
scoreProcessor.ResetFromReplayFrame(new OsuReplayFrame());

Assert.That(scoreProcessor.TotalScore.Value, Is.EqualTo(1_000_000));
Assert.That(scoreProcessor.JudgedHits, Is.EqualTo(1));
Assert.That(scoreProcessor.Combo.Value, Is.EqualTo(1));

// Reset with a miss instead.
scoreProcessor.ResetFromReplayFrame(new OsuReplayFrame
Expand All @@ -74,6 +76,7 @@ public void TestResetFromReplayFrame()

Assert.That(scoreProcessor.TotalScore.Value, Is.Zero);
Assert.That(scoreProcessor.JudgedHits, Is.EqualTo(1));
Assert.That(scoreProcessor.Combo.Value, Is.EqualTo(0));

// Reset with no judged hit.
scoreProcessor.ResetFromReplayFrame(new OsuReplayFrame
Expand All @@ -83,6 +86,7 @@ public void TestResetFromReplayFrame()

Assert.That(scoreProcessor.TotalScore.Value, Is.Zero);
Assert.That(scoreProcessor.JudgedHits, Is.Zero);
Assert.That(scoreProcessor.Combo.Value, Is.EqualTo(0));
}

private class TestJudgement : Judgement
Expand Down
1 change: 1 addition & 0 deletions osu.Game/Rulesets/Scoring/ScoreProcessor.cs
Expand Up @@ -460,6 +460,7 @@ public override void ResetFromReplayFrame(ReplayFrame frame)
currentMaximumScoringValues.BaseScore = maximum.BaseScore;
currentMaximumScoringValues.MaxCombo = maximum.MaxCombo;

Combo.Value = frame.Header.Combo;
HighestCombo.Value = frame.Header.MaxCombo;

scoreResultCounts.Clear();
Expand Down