Skip to content

Commit

Permalink
Fix shattering not destroying sentinels at the edge of the dungeon (#669
Browse files Browse the repository at this point in the history
)
  • Loading branch information
zenzombie authored Mar 23, 2024
1 parent f26d647 commit fc2ce59
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions changes/shatter-dungeon-boundary-monsters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a bug where shattering failed to destroy sentinels at the edge of the dungeon.
15 changes: 9 additions & 6 deletions src/brogue/Items.c
Original file line number Diff line number Diff line change
Expand Up @@ -4130,12 +4130,7 @@ static void crystalize(short radius) {
if ((player.loc.x - i) * (player.loc.x - i) + (player.loc.y - j) * (player.loc.y - j) <= radius * radius
&& !(pmap[i][j].flags & IMPREGNABLE)) {

if (i == 0 || i == DCOLS - 1 || j == 0 || j == DROWS - 1) {
pmap[i][j].layers[DUNGEON] = CRYSTAL_WALL; // don't dissolve the boundary walls
} else if (tileCatalog[pmap[i][j].layers[DUNGEON]].flags & (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_VISION)) {

pmap[i][j].layers[DUNGEON] = FORCEFIELD;
spawnDungeonFeature(i, j, &dungeonFeatureCatalog[DF_SHATTERING_SPELL], true, false);
if (tileCatalog[pmap[i][j].layers[DUNGEON]].flags & (T_OBSTRUCTS_PASSABILITY | T_OBSTRUCTS_VISION)) {

if (pmap[i][j].flags & HAS_MONSTER) {
monst = monsterAtLoc((pos){ i, j });
Expand All @@ -4146,6 +4141,14 @@ static void crystalize(short radius) {
freeCaptivesEmbeddedAt(i, j);
}
}

if (i == 0 || i == DCOLS - 1 || j == 0 || j == DROWS - 1) {
pmap[i][j].layers[DUNGEON] = CRYSTAL_WALL; // don't dissolve the boundary walls
} else {
pmap[i][j].layers[DUNGEON] = FORCEFIELD;
spawnDungeonFeature(i, j, &dungeonFeatureCatalog[DF_SHATTERING_SPELL], true, false);

}
}
}
}
Expand Down

0 comments on commit fc2ce59

Please sign in to comment.