v0.4.3a: added the ability for interlevelscene to report excessive waits

This commit is contained in:
Evan Debenham 2016-10-22 12:27:56 -04:00 committed by Evan Debenham
parent 22c1a0189c
commit 70c1bb46cf

View File

@ -67,6 +67,7 @@ public class InterlevelScene extends PixelScene {
private Thread thread; private Thread thread;
private Exception error = null; private Exception error = null;
private float waitingTime;
@Override @Override
public void create() { public void create() {
@ -132,11 +133,14 @@ public class InterlevelScene extends PixelScene {
} }
}; };
thread.start(); thread.start();
waitingTime = 0f;
} }
@Override @Override
public void update() { public void update() {
super.update(); super.update();
waitingTime += Game.elapsed;
float p = timeLeft / TIME_TO_FADE; float p = timeLeft / TIME_TO_FADE;
@ -180,6 +184,11 @@ public class InterlevelScene extends PixelScene {
} }
} ); } );
error = null; error = null;
} else if ((int)waitingTime == 10){
waitingTime = 11f;
ShatteredPixelDungeon.reportException(
new RuntimeException("waited more than 10 seconds on levelgen. Seed:" + Dungeon.seed + " depth:" + Dungeon.depth)
);
} }
break; break;
} }