formatting attached ball and chain

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)
This commit is contained in:
PatR
2022-04-09 11:45:43 -07:00
parent daadb53ec0
commit ea15bc05ec

View 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;
}