v1.0.2: fixed rare crashes if guardian traps couldn't find a location
This commit is contained in:
parent
789a2fc539
commit
7273342688
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user