v1.0.2: fixed rare crashes if guardian traps couldn't find a location

This commit is contained in:
Evan Debenham 2021-08-27 19:01:32 -04:00
parent 789a2fc539
commit 7273342688

View File

@ -58,8 +58,10 @@ public class GuardianTrap extends Trap {
Guardian guardian = new Guardian(); Guardian guardian = new Guardian();
guardian.state = guardian.WANDERING; guardian.state = guardian.WANDERING;
guardian.pos = Dungeon.level.randomRespawnCell( guardian ); guardian.pos = Dungeon.level.randomRespawnCell( guardian );
if (guardian.pos != -1) {
GameScene.add(guardian); GameScene.add(guardian);
guardian.beckon(Dungeon.hero.pos ); guardian.beckon(Dungeon.hero.pos);
}
} }
} }