From cd2280b5bf8947f29d379da16cb8826eff637fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 18 Aug 2020 15:18:52 +0200 Subject: [PATCH] Fix cheese indexing bug --- .../Difficulty/Preprocessing/StaminaCheeseDetector.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Difficulty/Preprocessing/StaminaCheeseDetector.cs b/osu.Game.Rulesets.Taiko/Difficulty/Preprocessing/StaminaCheeseDetector.cs index b53bc66f39..29e631e515 100644 --- a/osu.Game.Rulesets.Taiko/Difficulty/Preprocessing/StaminaCheeseDetector.cs +++ b/osu.Game.Rulesets.Taiko/Difficulty/Preprocessing/StaminaCheeseDetector.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using System.Collections.Generic; using osu.Game.Rulesets.Taiko.Objects; @@ -58,7 +59,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing { for (int j = repetitionStart; j < i; j++) { - hitObjects[i].StaminaCheese = true; + hitObjects[j].StaminaCheese = true; } } } @@ -81,9 +82,9 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing if (tlLength >= tl_min_repetitions) { - for (int j = i - tlLength; j < i; j++) + for (int j = Math.Max(0, i - tlLength); j < i; j++) { - hitObjects[i].StaminaCheese = true; + hitObjects[j].StaminaCheese = true; } } }