]> granicus.if.org Git - nethack/commitdiff
Intelligent peacefuls avoid digging shop or temple walls
authorPasi Kallinen <paxed@alt.org>
Sun, 22 Jan 2023 11:21:50 +0000 (13:21 +0200)
committerPasi Kallinen <paxed@alt.org>
Sun, 22 Jan 2023 11:28:24 +0000 (13:28 +0200)
doc/fixes3-7-0.txt
src/mon.c

index 43c24d6460e5e27dae03cf72a238ff0c8700a76c..e6c1535ba2387893c0bbef1cdab3eaf67408c64e 100644 (file)
@@ -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
index 279e3dbcbd885390e8cff072fbc96486d44544af..92523333f30dc213c1e0fefa5e5c57859c92dc54 100644 (file)
--- 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 */