From 2c2ba317b9237540d5babae9bae40c3c01c342b8 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 25 Dec 2016 15:47:25 +0100 Subject: [PATCH] prevent index out of bounds ex when loading checkpoint at time before first object --- src/itdelatrisu/opsu/states/Game.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/itdelatrisu/opsu/states/Game.java b/src/itdelatrisu/opsu/states/Game.java index 56cab90a..f9f0a238 100644 --- a/src/itdelatrisu/opsu/states/Game.java +++ b/src/itdelatrisu/opsu/states/Game.java @@ -342,7 +342,9 @@ public class Game extends BasicGameState { while (objectIndex < gameObjects.length && beatmap.objects[objectIndex].getTime() <= checkpoint) { objectIndex++; } - objectIndex--; + if (objectIndex > 0) { + objectIndex--; + } if (Options.isMergingSliders()) { int obj = objectIndex; while (obj < gameObjects.length) {