prevent index out of bounds ex when loading checkpoint at time before first object

This commit is contained in:
yugecin 2016-12-25 15:47:25 +01:00
parent eb1b3f3601
commit 2c2ba317b9

View File

@ -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) {