From 65905e6ce993805ecd267991d5b50e6210780e14 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Tue, 17 Jul 2007 13:35:54 +0000 Subject: [PATCH] minimal_xname() fix (trunk only) ansimpleoname() and siblings always reported statue and figurine type to be "of a giant ant" because the corpsenm field was left as 0. Explicitly set it to -1 in the minimal object and teach xname() to leave off the monster type in that situation, yielding just "a statue" or "a figurine". [It's tempting to classify this as an xname() bug since other object types which use corpsenm do so in doname().] No fixes entry; this is post-3.4.3 code. --- src/objnam.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/objnam.c b/src/objnam.c index 27b853c95..408d697be 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -308,7 +308,7 @@ register struct obj *obj; Strcat(buf, dn ? dn : actualn); /* If we use an() here we'd have to remember never to use */ /* it whenever calling doname() or xname(). */ - if (typ == FIGURINE) + if (typ == FIGURINE && omndx != NON_PM) Sprintf(eos(buf), " of a%s %s", index(vowels, *mons[omndx].mname) ? "n" : "", mons[omndx].mname); @@ -381,7 +381,7 @@ register struct obj *obj; Strcpy(buf, actualn); break; case ROCK_CLASS: - if (typ == STATUE) + if (typ == STATUE && omndx != NON_PM) Sprintf(buf, "%s%s of %s%s", (Role_if(PM_ARCHEOLOGIST) && (obj->spe & STATUE_HISTORIC)) ? "historic " : "", @@ -530,6 +530,7 @@ struct obj *obj; /* default is "on" for types which don't use it */ !objects[otyp].oc_uses_known; bareobj.quan = 1L; /* don't want plural */ + bareobj.corpsenm = NON_PM; /* suppress statue and figurine details */ bufp = distant_name(&bareobj, xname); /* xname(&bareobj) */ if (!strncmp(bufp, "uncursed ", 9)) bufp += 9; /* Role_if(PM_PRIEST) */