From f106cf41a2092148c6c270dc099f41b1f54c5930 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 5 Jul 2022 11:14:36 -0400 Subject: [PATCH] v1.3.0: fixed crash bugs with InterlevelScene --- .../shatteredpixeldungeon/scenes/InterlevelScene.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java index b92659d9a..4c0f53f60 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java @@ -126,8 +126,9 @@ public class InterlevelScene extends PixelScene { loadingDepth = 1; fadeTime = SLOW_FADE; } else { - loadingDepth = curTransition.destDepth; - if (!(Statistics.deepestFloor < loadingDepth)) { + if (curTransition != null) loadingDepth = curTransition.destDepth; + else loadingDepth = Dungeon.depth+1; + if (Statistics.deepestFloor >= loadingDepth) { fadeTime = FAST_FADE; } else if (loadingDepth == 6 || loadingDepth == 11 || loadingDepth == 16 || loadingDepth == 21) { @@ -142,7 +143,8 @@ public class InterlevelScene extends PixelScene { break; case ASCEND: fadeTime = FAST_FADE; - loadingDepth = curTransition.destDepth; + if (curTransition != null) loadingDepth = curTransition.destDepth; + else loadingDepth = Dungeon.depth-1; scrollSpeed = -5; break; case RETURN: