From de6878cef0d23cb63b863370e8d9c089fdff3914 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 22 Jun 2023 17:18:39 -0400 Subject: [PATCH] v2.1.3: getTransition now gives entrances if it cannot find specifics --- .../shatteredpixel/shatteredpixeldungeon/levels/Level.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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){