v0.9.0b: added safety checks to beacon of returning
This commit is contained in:
parent
1a3eade255
commit
a08b3a94a8
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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){
|
||||
|
|
Loading…
Reference in New Issue
Block a user