From: cohrs Date: Sun, 10 Feb 2002 07:34:26 +0000 (+0000) Subject: takes your corpse X-Git-Tag: MOVE2GIT~3216 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c789541cb7112d7ac9fe6f1b9d2df334e5d3c3b5;p=nethack takes your corpse use corpse_xname to generate corpse names as a result of yname() and also as used in the steal code. Now messages read "your XXX corpse". --- diff --git a/src/objnam.c b/src/objnam.c index 5920bf00a..733a19195 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1084,7 +1084,10 @@ struct obj *obj; char *s = shk_your(outbuf, obj); /* assert( s == outbuf ); */ int space_left = BUFSZ - strlen(s) - sizeof " "; - return strncat(strcat(s, " "), xname(obj), space_left); + /* "your corpse" is silly, use corpse_xname for this case */ + return strncat(strcat(s, " "), + (obj->otyp == CORPSE) ? + corpse_xname(obj, FALSE) : xname(obj), space_left); } /* capitalized variant of yname() */ diff --git a/src/steal.c b/src/steal.c index e5d190757..ce2d6a041 100644 --- a/src/steal.c +++ b/src/steal.c @@ -309,7 +309,9 @@ gotobj: cant_take: pline("%s tries to %s your %s but gives up.", Monnam(mtmp), how[rn2(SIZE(how))], - (otmp->owornmask & W_ARMOR) ? equipname(otmp) : xname(otmp)); + (otmp->owornmask & W_ARMOR) ? equipname(otmp) : + (otmp->otyp == CORPSE) ? corpse_xname(otmp, FALSE) : + xname(otmp)); /* the fewer items you have, the less likely the thief is going to stick around to try again (0) instead of running away (1) */