Skip to content

Commit

Permalink
Fix regression bug with shattering and dormant turrets (#701)
Browse files Browse the repository at this point in the history
Fixes issue introduced by #669 where dormant turrets would not get destroyed by
shattering and instead would become active.
  • Loading branch information
zenzombie authored Jul 3, 2024
1 parent 27472d2 commit ef342f3
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/brogue/Items.c
Original file line number Diff line number Diff line change
Expand Up @@ -4147,6 +4147,9 @@ static void crystalize(short radius) {

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 (pmap[i][j].flags & HAS_MONSTER) {
monst = monsterAtLoc((pos){ i, j });
if (monst->info.flags & MONST_ATTACKABLE_THRU_WALLS) {
Expand All @@ -4156,13 +4159,8 @@ 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);

pmap[i][j].layers[DUNGEON] = CRYSTAL_WALL; // boundary walls turn to crystal
}
}
}
Expand Down

0 comments on commit ef342f3

Please sign in to comment.