From 2e8adda0284180818cab2bdf3d415c882ee0a59a Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 9 Nov 2023 18:07:56 +0200 Subject: [PATCH] Clouds cannot have engravings in them ... so delete the existing engraving if a cloud is put on the map. --- doc/fixes3-7-0.txt | 1 + src/objnam.c | 1 + src/sp_lev.c | 2 ++ 3 files changed, 4 insertions(+) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 2844f001c..e41be55cf 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1277,6 +1277,7 @@ lightning has a small chance of melting iron bars make spell menu work with repeat when attempting to look up a named fruit in data.base, try harder set and check mon->mstate flags more consistently +fix sanity error when cloud was created over an engraving Fixes to 3.7.0-x General Problems Exposed Via git Repository diff --git a/src/objnam.c b/src/objnam.c index 356ea8fa1..c5cf00503 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -3384,6 +3384,7 @@ wizterrainwish(struct _readobjnam_data *d) lev->typ = CLOUD; lev->flags = 0; pline("A cloud."); + del_engr_at(x, y); madeterrain = TRUE; } else if (!BSTRCMPI(bp, p - 4, "door") || (d->doorless && !BSTRCMPI(bp, p - 7, "doorway"))) { diff --git a/src/sp_lev.c b/src/sp_lev.c index d603e3778..f3903f7a5 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -5255,6 +5255,8 @@ sel_set_ter(coordxy x, coordxy y, genericptr_t arg) levl[x][y].horizontal = 1; } else if (splev_init_present && levl[x][y].typ == ICE) { levl[x][y].icedpool = icedpools ? ICED_POOL : ICED_MOAT; + } else if (levl[x][y].typ == CLOUD) { + del_engr_at(x, y); /* clouds cannot have engravings */ } }