From: PatR Date: Tue, 17 Aug 2021 23:26:51 +0000 (-0700) Subject: [not] leashing long worm['s tail] X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=91ab9b313a96bce15d16c31948f5d83d5b95c1e2;p=nethack [not] leashing long worm['s tail] Leashing a long worm isn't allowed so leashing its tail isn't either. Make the rejection message be more specific for the tail case. --- diff --git a/src/apply.c b/src/apply.c index 5f15ee203..7b30334df 100644 --- a/src/apply.c +++ b/src/apply.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 apply.c $NHDT-Date: 1623807747 2021/06/16 01:42:27 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.345 $ */ +/* NetHack 3.7 apply.c $NHDT-Date: 1629242800 2021/08/17 23:26:40 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.347 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -674,8 +674,15 @@ use_leash(struct obj *obj) pline("%s has no extremities the leash would fit.", Monnam(mtmp)); } else if (!leashable(mtmp)) { + char lmonbuf[BUFSZ]; + char *lmonnam = l_monnam(mtmp); + + if (cc.x != mtmp->mx || cc.y != mtmp->my) { + Sprintf(lmonbuf, "%s tail", s_suffix(lmonnam)); + lmonnam = lmonbuf; + } pline("The leash won't fit onto %s%s.", spotmon ? "your " : "", - l_monnam(mtmp)); + lmonnam); } else { You("slip the leash around %s%s.", spotmon ? "your " : "", l_monnam(mtmp));