]> granicus.if.org Git - nethack/commitdiff
takes your corpse
authorcohrs <cohrs>
Sun, 10 Feb 2002 07:34:26 +0000 (07:34 +0000)
committercohrs <cohrs>
Sun, 10 Feb 2002 07:34:26 +0000 (07:34 +0000)
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".

src/objnam.c
src/steal.c

index 5920bf00a0a92a5791c681751831a71180bb8c93..733a191955152a6d77f52cfae70d6d4a748fc734 100644 (file)
@@ -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() */
index e5d190757e3522a40ca58fe99d91fba604454155..ce2d6a041e3b01a6adfe7148f803a23d99ac95b0 100644 (file)
@@ -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) */