diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index 6bda45783..963b2d892 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -511,6 +511,9 @@ public abstract class Level implements Bundlable { } public LevelTransition getTransition(LevelTransition.Type type){ + if (transitions.isEmpty()){ + return null; + } for (LevelTransition transition : transitions){ //if we don't specify a type, prefer to return any entrance if (type == null && @@ -520,7 +523,7 @@ public abstract class Level implements Bundlable { return transition; } } - return (type == null && !transitions.isEmpty() ? transitions.get(0) : null); + return type != null ? getTransition(null) : transitions.get(0); } public LevelTransition getTransition(int cell){