fix crashing caused by merged slider when map doesn't have sliders

This commit is contained in:
yugecin 2016-12-10 17:19:45 +01:00
parent a40c8b5d31
commit 961ea097c7

View File

@ -1534,7 +1534,9 @@ public class Game extends BasicGameState {
curvepoints.addAll(Arrays.asList(((Slider) gameObject).getCurve().getCurvePoints()));
}
}
knorkesliders = new FakeCombinedCurve(curvepoints.toArray(new Vec2f[curvepoints.size()]));
if (curvepoints.size() > 0) {
knorkesliders = new FakeCombinedCurve(curvepoints.toArray(new Vec2f[curvepoints.size()]));
}
}
}
@ -1603,7 +1605,7 @@ public class Game extends BasicGameState {
* @param trackPosition the track position
*/
private void drawHitObjects(Graphics g, int trackPosition) {
if (Options.isMergingSliders()) {
if (Options.isMergingSliders() && knorkesliders != null) {
knorkesliders.draw(Color.white, this.slidercurveFrom, this.slidercurveTo);
}
// include previous object in follow points