v0.6.4a: fixed bugs relating to interlevelscene being reset
This commit is contained in:
parent
04dfde31ff
commit
a7c442dde6
|
@ -72,8 +72,8 @@ public class InterlevelScene extends PixelScene {
|
|||
|
||||
private RenderedText message;
|
||||
|
||||
private Thread thread;
|
||||
private Exception error = null;
|
||||
private static Thread thread;
|
||||
private static Exception error = null;
|
||||
private float waitingTime;
|
||||
|
||||
@Override
|
||||
|
@ -164,6 +164,7 @@ public class InterlevelScene extends PixelScene {
|
|||
phase = Phase.FADE_IN;
|
||||
timeLeft = TIME_TO_FADE;
|
||||
|
||||
if (thread == null) {
|
||||
thread = new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -195,7 +196,7 @@ public class InterlevelScene extends PixelScene {
|
|||
}
|
||||
|
||||
if ((Dungeon.depth % 5) == 0) {
|
||||
Sample.INSTANCE.load( Assets.SND_BOSS );
|
||||
Sample.INSTANCE.load(Assets.SND_BOSS);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
|
@ -211,6 +212,7 @@ public class InterlevelScene extends PixelScene {
|
|||
}
|
||||
};
|
||||
thread.start();
|
||||
}
|
||||
waitingTime = 0f;
|
||||
}
|
||||
|
||||
|
@ -241,6 +243,8 @@ public class InterlevelScene extends PixelScene {
|
|||
|
||||
if ((timeLeft -= Game.elapsed) <= 0) {
|
||||
Game.switchScene( GameScene.class );
|
||||
thread = null;
|
||||
error = null;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -260,11 +264,19 @@ public class InterlevelScene extends PixelScene {
|
|||
Game.switchScene( StartScene.class );
|
||||
}
|
||||
} );
|
||||
thread = null;
|
||||
error = null;
|
||||
} else if ((int)waitingTime == 10){
|
||||
waitingTime = 11f;
|
||||
String s = "";
|
||||
for (StackTraceElement t : thread.getStackTrace()){
|
||||
s += "\n";
|
||||
s += t.toString();
|
||||
}
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user