From: Sean Hunt Date: Sun, 24 May 2015 15:04:04 +0000 (+0900) Subject: Make long worms unleashable. X-Git-Tag: NetHack-3.6.0_RC01~372 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b5513b7db0101af1bbcb1a600c25c05a73e5f542;p=nethack Make long worms unleashable. 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. --- diff --git a/doc/fixes35.0 b/doc/fixes35.0 index f3086b3fd..a6d6460ae 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -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 diff --git a/src/apply.c b/src/apply.c index 59fea44a1..959fde16e 100644 --- a/src/apply.c +++ b/src/apply.c @@ -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;