]> granicus.if.org Git - nethack/commitdiff
Bugle playing should not scare some monsters
authorPasi Kallinen <paxed@alt.org>
Mon, 26 Jul 2021 18:40:19 +0000 (21:40 +0300)
committerPasi Kallinen <paxed@alt.org>
Mon, 26 Jul 2021 18:40:23 +0000 (21:40 +0300)
Make awaken_soldiers match awaken_monsters in what monsters
it can scare.

doc/fixes37.0
src/music.c

index e2b02d43b84be7c8b643f3f1b634f03483c35a3a..173da319d2b3df80747e3a8b8dfaa38cf6364ba2 100644 (file)
@@ -572,6 +572,7 @@ fix heap-use-after-free when attacking monster with potion
 for "a" vs "an", add ukulele and uke as exceptions for "an u<anything>"
 add new extended command #retravel
 remove special doinv key, functionality was equal to BIND=0:inventory
+some monsters should not have been scared of bugle playing
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index 1441d28fc144e641ec97722503f2f653b0e16659..8d372d38fbc369429724c9a5c92f138136458239 100644 (file)
@@ -181,7 +181,9 @@ awaken_soldiers(struct monst* bugler  /* monster that played instrument */)
                 && (mtmp->mstrategy & STRAT_WAITMASK) != 0)
                 mtmp->mstrategy &= ~STRAT_WAITMASK;
             else if (distm < distance / 3
-                     && !resist(mtmp, TOOL_CLASS, 0, NOTELL))
+                     && !resist(mtmp, TOOL_CLASS, 0, NOTELL)
+                     /* some monsters are immune */
+                     && onscary(0, 0, mtmp))
                 monflee(mtmp, 0, FALSE, TRUE);
         }
     }