v2.4.0: fixed geomancer/sappers placing boulders next to entrance

This commit is contained in:
Evan Debenham
2024-03-18 12:54:33 -04:00
parent 24f5d738cf
commit 8f237dc66a
2 changed files with 6 additions and 2 deletions

View File

@@ -806,7 +806,9 @@ public class GnollGeomancer extends Mob {
@Override @Override
public void affectCell(int cell) { public void affectCell(int cell) {
if (Dungeon.level.map[cell] != Terrain.EMPTY_SP && Random.Int(3) == 0) { if (Dungeon.level.map[cell] != Terrain.EMPTY_SP
&& !Dungeon.level.adjacent(cell, Dungeon.level.entrance())
&& Random.Int(3) == 0) {
Level.set(cell, Terrain.MINE_BOULDER); Level.set(cell, Terrain.MINE_BOULDER);
GameScene.updateMap(cell); GameScene.updateMap(cell);
} }

View File

@@ -512,7 +512,9 @@ public abstract class Level implements Bundlable {
for (LevelTransition transition : transitions){ for (LevelTransition transition : transitions){
//if we don't specify a type, prefer to return any entrance //if we don't specify a type, prefer to return any entrance
if (type == null && if (type == null &&
(transition.type == LevelTransition.Type.REGULAR_ENTRANCE || transition.type == LevelTransition.Type.SURFACE)){ (transition.type == LevelTransition.Type.REGULAR_ENTRANCE
|| transition.type == LevelTransition.Type.BRANCH_ENTRANCE
|| transition.type == LevelTransition.Type.SURFACE)){
return transition; return transition;
} else if (transition.type == type){ } else if (transition.type == type){
return transition; return transition;