v0.7.5b: fixed flying enemies not opening doors in some cases

This commit is contained in:
Evan Debenham 2019-10-11 23:01:10 -04:00
parent 2105802d89
commit cb59d5d629
3 changed files with 5 additions and 7 deletions

View File

@ -568,10 +568,6 @@ public abstract class Char extends Actor {
pos = step;
if (flying && Dungeon.level.map[pos] == Terrain.DOOR) {
Door.enter( pos );
}
if (this != Dungeon.hero) {
sprite.visible = Dungeon.level.heroFOV[pos];
}

View File

@ -102,9 +102,7 @@ public class Swarm extends Mob {
clone.pos = Random.element( candidates );
clone.state = clone.HUNTING;
if (Dungeon.level.map[clone.pos] == Terrain.DOOR) {
Door.enter( clone.pos );
}
Dungeon.level.occupyCell(clone);
GameScene.add( clone, SPLIT_DELAY );
Actor.addDelayed( new Pushing( clone, pos, clone.pos ), -1 );

View File

@ -797,6 +797,10 @@ public abstract class Level implements Bundlable {
//characters which are not the hero or a sheep 'soft' press cells
pressCell( ch.pos, ch instanceof Hero || ch instanceof Sheep);
} else {
if (map[ch.pos] == Terrain.DOOR){
Door.enter( ch.pos );
}
}
}