diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java index 9612bf184..5092edbca 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java @@ -355,7 +355,7 @@ public class Dungeon { if (pos == -2){ pos = level.exit; - } else if (pos < 0 || pos >= level.length()){ + } else if (pos < 0 || pos >= level.length() || (!level.passable[pos] && !level.avoid[pos])){ pos = level.entrance; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/BeaconOfReturning.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/BeaconOfReturning.java index 19fb0fec2..25c943b76 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/BeaconOfReturning.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/spells/BeaconOfReturning.java @@ -120,6 +120,9 @@ public class BeaconOfReturning extends Spell { } if (returnDepth == Dungeon.depth) { + if (!Dungeon.level.passable[returnPos] && !Dungeon.level.avoid[returnPos]){ + returnPos = Dungeon.level.entrance; + } ScrollOfTeleportation.appear( hero, returnPos ); for(Mob m : Dungeon.level.mobs){ if (m.pos == hero.pos){