From 454978fadd1693a7a6e5a5506a15ea268ed01098 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 28 Dec 2024 20:33:15 +0200 Subject: [PATCH] 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... --- src/sp_lev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sp_lev.c b/src/sp_lev.c index 135a72dec..16adaf345 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -2924,7 +2924,12 @@ fill_empty_maze(void) TRUE); } for (x = rnd((int) (12 * mapfact) / 100); x; x--) { + struct trap *ttmp; + 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); } for (x = rn2(2); x; x--) {