v0.6.4a: fixed bugs relating to interlevelscene being reset

This commit is contained in:
Evan Debenham 2018-04-06 23:52:11 -04:00
parent 04dfde31ff
commit a7c442dde6

View File

@ -72,8 +72,8 @@ public class InterlevelScene extends PixelScene {
private RenderedText message; private RenderedText message;
private Thread thread; private static Thread thread;
private Exception error = null; private static Exception error = null;
private float waitingTime; private float waitingTime;
@Override @Override
@ -164,6 +164,7 @@ public class InterlevelScene extends PixelScene {
phase = Phase.FADE_IN; phase = Phase.FADE_IN;
timeLeft = TIME_TO_FADE; timeLeft = TIME_TO_FADE;
if (thread == null) {
thread = new Thread() { thread = new Thread() {
@Override @Override
public void run() { public void run() {
@ -211,6 +212,7 @@ public class InterlevelScene extends PixelScene {
} }
}; };
thread.start(); thread.start();
}
waitingTime = 0f; waitingTime = 0f;
} }
@ -241,6 +243,8 @@ public class InterlevelScene extends PixelScene {
if ((timeLeft -= Game.elapsed) <= 0) { if ((timeLeft -= Game.elapsed) <= 0) {
Game.switchScene( GameScene.class ); Game.switchScene( GameScene.class );
thread = null;
error = null;
} }
break; break;
@ -260,11 +264,19 @@ public class InterlevelScene extends PixelScene {
Game.switchScene( StartScene.class ); Game.switchScene( StartScene.class );
} }
} ); } );
thread = null;
error = null; error = null;
} else if ((int)waitingTime == 10){ } else if ((int)waitingTime == 10){
waitingTime = 11f; waitingTime = 11f;
String s = "";
for (StackTraceElement t : thread.getStackTrace()){
s += "\n";
s += t.toString();
}
ShatteredPixelDungeon.reportException( ShatteredPixelDungeon.reportException(
new RuntimeException("waited more than 10 seconds on levelgen. Seed:" + Dungeon.seed + " depth:" + Dungeon.depth) new RuntimeException("waited more than 10 seconds on levelgen. " +
"Seed:" + Dungeon.seed + " depth:" + Dungeon.depth + "trace:" +
s)
); );
} }
break; break;