v2.3.0: gnoll rockfall traps now ignore cells next to barricades
This commit is contained in:
@@ -83,6 +83,15 @@ public class RockfallTrap extends Trap {
|
||||
PathFinder.buildDistanceMap( pos, BArray.not( Dungeon.level.solid, null ), 2 );
|
||||
for (int i = 0; i < PathFinder.distance.length; i++) {
|
||||
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
|
||||
if (Dungeon.level instanceof MiningLevel){
|
||||
boolean barricade = false;
|
||||
for (int j : PathFinder.NEIGHBOURS9){
|
||||
if (Dungeon.level.map[i+j] == Terrain.BARRICADE){
|
||||
barricade = true;
|
||||
}
|
||||
}
|
||||
if (barricade) continue;
|
||||
}
|
||||
rockCells.add(i);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user