From 841707b61f7798b49dc9defb5e30389d81fd0864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adonais=20Romero=20Gonz=C3=A1lez?= Date: Sun, 9 Oct 2016 14:09:07 -0500 Subject: [PATCH] Not animate stars over MaxStars --- osu.Desktop.VisualTests/Tests/TestCaseScoreCounter.cs | 2 +- osu.Game/Graphics/UserInterface/StarCounter.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) 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;