Fix: baalz_fixup didn't account for level rotation

Because some spots in the fly's 'legs' on the Baalzebub lair level are
specified as pools in the level file, then later converted to walls in a
post-generation fixup routine, monsters can be generated on those spots
and then left walled up and inaccessible, Cask of Amontillado style.
For the love of God, makemon-tresor!

Some code already existed to relocate these monsters after generating
the level, but it depends on misorientated 'leg segments' being fixed up
in a particular way.  That wasn't being triggered because it didn't
account for the possible rotation of the level; as a result, the
monsters in the leg segments wouldn't be relocated, and the leg segments
themselves would continue to have the wrong orientation.

Account for possible level rotation so that the monsters are relocated
properly (and the leg segments are 'fixed').
This commit is contained in:
Michael Meyer
2021-09-30 09:43:14 -04:00
committed by PatR
parent da859c5eb8
commit 00b3b955af

View File

@@ -418,17 +418,18 @@ baalz_fixup(void)
both top and bottom gets a bogus extra connection to room area,
producing unwanted rectangles; change back to separated legs */
x = g.bughack.delarea.x1, y = g.bughack.delarea.y1;
if (isok(x, y) && levl[x][y].typ == TLWALL
if (isok(x, y) && (levl[x][y].typ == TLWALL || levl[x][y].typ == TRWALL)
&& isok(x, y + 1) && levl[x][y + 1].typ == TUWALL) {
levl[x][y].typ = BRCORNER;
levl[x][y].typ = (levl[x][y].typ == TLWALL) ? BRCORNER : BLCORNER;
levl[x][y + 1].typ = HWALL;
if ((mtmp = m_at(x, y)) != 0) /* something at temporary pool... */
(void) rloc(mtmp, FALSE);
}
x = g.bughack.delarea.x2, y = g.bughack.delarea.y2;
if (isok(x, y) && levl[x][y].typ == TLWALL
if (isok(x, y) && (levl[x][y].typ == TLWALL || levl[x][y].typ == TRWALL)
&& isok(x, y - 1) && levl[x][y - 1].typ == TDWALL) {
levl[x][y].typ = TRCORNER;
levl[x][y].typ = (levl[x][y].typ == TLWALL) ? TRCORNER : TLCORNER;
levl[x][y - 1].typ = HWALL;
if ((mtmp = m_at(x, y)) != 0) /* something at temporary pool... */
(void) rloc(mtmp, FALSE);