prevent arrayindexoutofbounds

This commit is contained in:
yugecin 2016-09-30 19:56:47 +02:00
parent b12ed6fa0e
commit 8c7531e550

View File

@ -789,6 +789,12 @@ public class Game extends BasicGameState {
return; return;
} }
GameObject g = gameObjects[objectIndex];
if (g.isCircle() || g.isSlider() && g.getTime() <= trackPosition) {
Cursor.lastObjColor = g.getColor();
Cursor.lastMirroredObjColor = g.getMirroredColor();
}
// timing points // timing points
if (timingPointIndex < beatmap.timingPoints.size()) { if (timingPointIndex < beatmap.timingPoints.size()) {
TimingPoint timingPoint = beatmap.timingPoints.get(timingPointIndex); TimingPoint timingPoint = beatmap.timingPoints.get(timingPointIndex);
@ -881,11 +887,6 @@ public class Game extends BasicGameState {
break; break;
} }
} }
GameObject g = gameObjects[objectIndex];
if (g.isCircle() || g.isSlider() && g.getTime() <= trackPosition) {
Cursor.lastObjColor = g.getColor();
Cursor.lastMirroredObjColor = g.getMirroredColor();
}
} }
@Override @Override