From a99c47376203304020cf8951848ba1a44d883970 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 22 Jan 2023 13:21:50 +0200 Subject: [PATCH] Intelligent peacefuls avoid digging shop or temple walls --- doc/fixes3-7-0.txt | 1 + src/mon.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 43c24d646..e6c1535ba 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1091,6 +1091,7 @@ digging is noisy polymorphing into fire elemental allows you eat flammable items hitting sleeping monsters will cause them to wake up noisily demon gating happens more in Gehennom and less outside it +intelligent peacefuls avoid digging shop or temple walls Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/mon.c b/src/mon.c index 279e3dbcb..92523333f 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1904,6 +1904,12 @@ mfndpos( && !((flag & ALLOW_WALL) && may_passwall(nx, ny)) && !((IS_TREE(ntyp) ? treeok : rockok) && may_dig(nx, ny))) continue; + /* intelligent peacefuls avoid digging shop/temple walls */ + if (IS_ROCK(ntyp) && rockok + && !mindless(mon->data) && (mon->mpeaceful || mon->mtame) + && (*in_rooms(nx, ny, TEMPLE) || *in_rooms(nx, ny, SHOPBASE)) + && !(*in_rooms(x, y, TEMPLE) || *in_rooms(x, y, SHOPBASE))) + continue; if (IS_WATERWALL(ntyp) && !is_swimmer(mdat)) continue; /* KMH -- Added iron bars */