don't recreate knorkesliders when loading checkpoint (part of #104)

This commit is contained in:
yugecin 2016-12-25 18:29:57 +01:00
parent bcb805a23a
commit 3b91247d12

View File

@ -1606,6 +1606,7 @@ public class Game extends BasicGameState {
SoundController.mute(false); SoundController.mute(false);
if (Options.isMergingSliders()) { if (Options.isMergingSliders()) {
if (knorkesliders == null) {
// let's create knorkesliders // let's create knorkesliders
List<Vec2f> curvepoints = new ArrayList<>(); List<Vec2f> curvepoints = new ArrayList<>();
for (GameObject gameObject : gameObjects) { for (GameObject gameObject : gameObjects) {
@ -1617,6 +1618,15 @@ public class Game extends BasicGameState {
if (curvepoints.size() > 0) { if (curvepoints.size() > 0) {
knorkesliders = new FakeCombinedCurve(curvepoints.toArray(new Vec2f[curvepoints.size()])); knorkesliders = new FakeCombinedCurve(curvepoints.toArray(new Vec2f[curvepoints.size()]));
} }
} else {
int base = 0;
for (GameObject gameObject : gameObjects) {
if (gameObject.isSlider()) {
((Slider) gameObject).baseSliderFrom = base;
base += ((Slider) gameObject).getCurve().getCurvePoints().length;
}
}
}
} }
} }
@ -1647,6 +1657,8 @@ public class Game extends BasicGameState {
// container.setMouseGrabbed(false); // container.setMouseGrabbed(false);
skippedToCheckpoint = false; skippedToCheckpoint = false;
knorkesliders = null;
sbOverlay.leave(); sbOverlay.leave();
Dancer.instance.setGameObjects(null); Dancer.instance.setGameObjects(null);