]> granicus.if.org Git - nethack/commitdiff
fix #H8534 - thrown pick-axe vs "scum!"
authorPatR <rankin@nethack.org>
Fri, 12 Apr 2019 08:33:42 +0000 (01:33 -0700)
committerPatR <rankin@nethack.org>
Fri, 12 Apr 2019 08:33:42 +0000 (01:33 -0700)
[I accidentally left this out of the earlier patch.]

Change in meaning of mnearto()'s return value wasn't progagated to
shkcatch(). Make it an int instead of boolean so that it can
communicate both 'moved successfully' and 'moved but had to move
another monster out of the way to do so'.

src/shk.c

index ef5bc02063918dba8151da1ac9775d7fe048cfae..649a84521503e44528e141f6a5365583ed236c85 100644 (file)
--- a/src/shk.c
+++ b/src/shk.c
@@ -1,4 +1,4 @@
-/* NetHack 3.6 shk.c   $NHDT-Date: 1551738135 2019/03/04 22:22:15 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.157 $ */
+/* NetHack 3.6 shk.c   $NHDT-Date: 1555058014 2019/04/12 08:33:34 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.158 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2012. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -3397,7 +3397,7 @@ register xchar x, y;
         && dist2(shkp->mx, shkp->my, x, y) < 3
         /* if it is the shk's pos, you hit and anger him */
         && (shkp->mx != x || shkp->my != y)) {
-        if (mnearto(shkp, x, y, TRUE) && !Deaf && !muteshk(shkp))
+        if (mnearto(shkp, x, y, TRUE) == 2 && !Deaf && !muteshk(shkp))
             verbalize("Out of my way, scum!");
         if (cansee(x, y)) {
             pline("%s nimbly%s catches %s.", Shknam(shkp),