diff --git a/osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs b/osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs index 2ad177a6be..144adf9098 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs @@ -141,7 +141,7 @@ namespace osu.Desktop.Tests AddButton(@"Alter stars", delegate { - tc.Count = RNG.NextSingle() * tc.MaxStars; + tc.Count = RNG.NextSingle() * (tc.MaxStars + 1); text.Text = tc.Count.ToString("0.00"); }); diff --git a/osu.Game/Graphics/UserInterface/StarCounter.cs b/osu.Game/Graphics/UserInterface/StarCounter.cs index d4eeb202fb..b4576e6104 100644 --- a/osu.Game/Graphics/UserInterface/StarCounter.cs +++ b/osu.Game/Graphics/UserInterface/StarCounter.cs @@ -126,6 +126,9 @@ namespace osu.Game.Graphics.UserInterface protected void transformStar(int i, bool isIncrement) { + if (i >= MaxStars) + return; + if (Clock == null) return;