]> granicus.if.org Git - nethack/commitdiff
Make long worms unleashable.
authorSean Hunt <scshunt@csclub.uwaterloo.ca>
Sun, 24 May 2015 15:04:04 +0000 (00:04 +0900)
committernhmall <mjnh@persona.ca>
Sun, 24 May 2015 15:12:27 +0000 (11:12 -0400)
Fixes a bug reported by ais523. Rather than account for individual
segments, I opted just to make them unleashable, because it's not very
useful behaviour anyhow.

doc/fixes35.0
src/apply.c

index f3086b3fd3a6da0453c95e9480c2c5a8db7851ac..a6d6460ae9d3f2be5efc4fbca7c0185c95834fc5 100644 (file)
@@ -915,6 +915,7 @@ monsters without hands can no longer pick up piles of objects (with
     certain exceptions)
 uncursed enchant weapon now correctly fixes erosion
 scroll of earth messages cleaned up
+long worms can no longer be leashed
 
 
 Platform- and/or Interface-Specific Fixes
index 59fea44a18a126eea14b4177d0cc609ea788b3be..959fde16ead2ba2f1a254dacd46c5bf286e75294 100644 (file)
@@ -544,6 +544,13 @@ void unleash_all() /* player is about to die (for bones) */
 
 #define MAXLEASHED 2
 
+static boolean
+leashable(mtmp)
+struct monst *mtmp;
+{
+    return mtmp->mnum != PM_LONG_WORM;
+}
+
 /* ARGSUSED */
 STATIC_OVL void
 use_leash(obj)
@@ -593,6 +600,12 @@ got_target:
                   spotmon ? l_monnam(mtmp) : "monster");
             return;
         }
+        if (!leashable(mtmp)) {
+            pline("The leash won't fit onto %s%s.", spotmon ? "your " : "",
+                  l_monnam(mtmp));
+            return;
+        }
+
         You("slip the leash around %s%s.", spotmon ? "your " : "",
             l_monnam(mtmp));
         mtmp->mleashed = 1;