From 8c7531e5503562ca785df862ccf01435d9c7ee0e Mon Sep 17 00:00:00 2001 From: yugecin Date: Fri, 30 Sep 2016 19:56:47 +0200 Subject: [PATCH] prevent arrayindexoutofbounds --- src/itdelatrisu/opsu/states/Game.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/itdelatrisu/opsu/states/Game.java b/src/itdelatrisu/opsu/states/Game.java index cf51ba80..f7e409f2 100644 --- a/src/itdelatrisu/opsu/states/Game.java +++ b/src/itdelatrisu/opsu/states/Game.java @@ -789,6 +789,12 @@ public class Game extends BasicGameState { return; } + GameObject g = gameObjects[objectIndex]; + if (g.isCircle() || g.isSlider() && g.getTime() <= trackPosition) { + Cursor.lastObjColor = g.getColor(); + Cursor.lastMirroredObjColor = g.getMirroredColor(); + } + // timing points if (timingPointIndex < beatmap.timingPoints.size()) { TimingPoint timingPoint = beatmap.timingPoints.get(timingPointIndex); @@ -881,11 +887,6 @@ public class Game extends BasicGameState { break; } } - GameObject g = gameObjects[objectIndex]; - if (g.isCircle() || g.isSlider() && g.getTime() <= trackPosition) { - Cursor.lastObjColor = g.getColor(); - Cursor.lastMirroredObjColor = g.getMirroredColor(); - } } @Override