From fc2ce59dc7b27a9e7c1c74d68519deb6d8b6648d Mon Sep 17 00:00:00 2001 From: Brandon <71573970+zenzombie@users.noreply.github.com> Date: Sat, 23 Mar 2024 07:43:59 -0700 Subject: [PATCH] Fix shattering not destroying sentinels at the edge of the dungeon (#669) --- changes/shatter-dungeon-boundary-monsters.md | 1 + src/brogue/Items.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 changes/shatter-dungeon-boundary-monsters.md diff --git a/changes/shatter-dungeon-boundary-monsters.md b/changes/shatter-dungeon-boundary-monsters.md new file mode 100644 index 00000000..fdbefe9b --- /dev/null +++ b/changes/shatter-dungeon-boundary-monsters.md @@ -0,0 +1 @@ +Fixed a bug where shattering failed to destroy sentinels at the edge of the dungeon. \ No newline at end of file diff --git a/src/brogue/Items.c b/src/brogue/Items.c index fdae423e..608fdbca 100644 --- a/src/brogue/Items.c +++ b/src/brogue/Items.c @@ -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 }); @@ -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); + + } } } }