v2.5.0: fixed crash errors in new pitfall trap logic

This commit is contained in:
Evan Debenham
2024-08-22 12:57:10 -04:00
parent 1e344ec17f
commit 992080252f
@@ -63,7 +63,7 @@ public class PitfallTrap extends Trap {
for (int i : PathFinder.NEIGHBOURS9){
if (!Dungeon.level.solid[pos+i] || Dungeon.level.passable[pos+i]){
CellEmitter.floor(pos+i).burst(PitfallParticle.FACTORY4, 8);
positions.add(i);
positions.add(pos+i);
}
}
p.setPositions(positions);
@@ -95,7 +95,8 @@ public class PitfallTrap extends Trap {
if (depth == Dungeon.depth && branch == Dungeon.branch && positions != null) {
for (int cell : positions) {
if (Dungeon.level.solid[cell] && !Dungeon.level.passable[cell]){
if (!Dungeon.level.insideMap(cell)
|| (Dungeon.level.solid[cell] && !Dungeon.level.passable[cell])){
continue;
}