]> granicus.if.org Git - nethack/commitdiff
corpse_xname tweak (trunk only)
authornethack.rankin <nethack.rankin>
Thu, 26 Apr 2007 02:13:17 +0000 (02:13 +0000)
committernethack.rankin <nethack.rankin>
Thu, 26 Apr 2007 02:13:17 +0000 (02:13 +0000)
     Noticed while testing a patch for touching cockatrice corpses;
corpse_xname(,, CXN_ARTICLE) would produce "a cockatrice corpses" when the
object stack quantity was greater than 1.  (This applies to the post-3.4.3
expansion of corpse_xname() in the trunk code, so no fixes entry.)

src/objnam.c

index d642a08a435d37e4e1ef1028a833f533d9c41358..126387f05e9ca72939b6f0f8144758e9824ddce1 100644 (file)
@@ -999,7 +999,10 @@ unsigned cxn_flags;        /* bitmask of CXN_xxx values */
        if (!omit_corpse) {
            Strcat(nambuf, " corpse");
            /* makeplural(nambuf) => append "s" to "corpse" */
-           if (otmp->quan > 1L && !ignore_quan) Strcat(nambuf, "s");
+           if (otmp->quan > 1L && !ignore_quan) {
+               Strcat(nambuf, "s");
+               any_prefix = FALSE;     /* avoid "a newt corpses" */
+           }
        }
 
        /* it's safe to overwrite our nambuf after an() has copied