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