]> granicus.if.org Git - nethack/commitdiff
formatting attached ball and chain
authorPatR <rankin@nethack.org>
Sat, 9 Apr 2022 18:45:43 +0000 (11:45 -0700)
committerPatR <rankin@nethack.org>
Sat, 9 Apr 2022 18:45:43 +0000 (11:45 -0700)
When punished, the ball gets formatted as
| heavy iron ball (chained to you)
but the chain was just "iron chain".  Since iron golems leave some
of those behind, doname() shouldn't just assume that you know which
chain is locked to your leg.  Change the formatting for uchain to
| iron chain (attached to you)

src/objnam.c

index 6a44d1b5e67f40a66b417da831729857b560957b..dfff2d35df7606f8197b2e71cb41d83d6762747f 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 objnam.c        $NHDT-Date: 1646688068 2022/03/07 21:21:08 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.348 $ */
+/* NetHack 3.7 objnam.c        $NHDT-Date: 1649529937 2022/04/09 18:45:37 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.359 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2011. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -1333,8 +1333,9 @@ doname_base(
     case BALL_CLASS:
     case CHAIN_CLASS:
         add_erosion_words(obj, prefix);
-        if (obj->owornmask & W_BALL)
-            Strcat(bp, " (chained to you)");
+        if (obj->owornmask & (W_BALL | W_CHAIN))
+            Sprintf(eos(bp), " (%s to you)",
+                    (obj->owornmask & W_BALL) ? "chained" : "attached");
         break;
     }