Avoid boulder-over-pit sanity when filling empty maze

This shouldn't happen unless doing special level commands in
strange order, but handle it anyway...
This commit is contained in:
Pasi Kallinen
2024-12-28 20:33:18 +02:00
parent 72fb06a40a
commit 454978fadd
+5
View File
@@ -2924,7 +2924,12 @@ fill_empty_maze(void)
TRUE); TRUE);
} }
for (x = rnd((int) (12 * mapfact) / 100); x; x--) { for (x = rnd((int) (12 * mapfact) / 100); x; x--) {
struct trap *ttmp;
maze1xy(&mm, DRY); maze1xy(&mm, DRY);
if ((ttmp = t_at(mm.x, mm.y)) != 0
&& (is_pit(ttmp->ttyp) || is_hole(ttmp->ttyp)))
continue;
(void) mksobj_at(BOULDER, mm.x, mm.y, TRUE, FALSE); (void) mksobj_at(BOULDER, mm.x, mm.y, TRUE, FALSE);
} }
for (x = rn2(2); x; x--) { for (x = rn2(2); x; x--) {