]> granicus.if.org Git - nethack/commitdiff
artifact name formatting bit
authorPatR <rankin@nethack.org>
Mon, 6 Jun 2022 23:15:07 +0000 (16:15 -0700)
committerPatR <rankin@nethack.org>
Mon, 6 Jun 2022 23:15:07 +0000 (16:15 -0700)
All the quest artifacts are named "The <something> of <someone>".
Change xname() to force "the" instead of "The" when that occurs in
the middle of "a skeleton key named The Master Key of Thievery" or
"a pair of lenses named The Eyes of the Overworld".

This change isn't applied to user-assigned names; they're used as-is.

doc/fixes3-7-0.txt
src/objnam.c

index 7846e58386d0ab85954f1cb698ba5452f566e5cb..f3851592ba347254a229c19ea66e94b0f90c3446 100644 (file)
@@ -1,4 +1,4 @@
-HDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.933 $ $NHDT-Date: 1654205933 2022/06/02 21:38:53 $
+HDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.939 $ $NHDT-Date: 1654557302 2022/06/06 23:15:02 $
 
 General Fixes and Modified Features
 -----------------------------------
@@ -917,6 +917,8 @@ if player gave a subset count when removing an item from a container, then got
        stacks of gold inside a container
 two-handed weapon message stated "welds to monster's hand" instead of
        "welds to monster's hands"
+when formatting an object, avoid capitalization of "The" in "<item> named
+       The <quest-artifact>"
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index c17765cee85c8c5ab56a075e51aa70446add6b30..c6baa66648c5e17a5186a5dc753b451ca5cbe94a 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 objnam.c        $NHDT-Date: 1654200083 2022/06/02 20:01:23 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.366 $ */
+/* NetHack 3.7 objnam.c        $NHDT-Date: 1654557302 2022/06/06 23:15:02 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.368 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2011. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -501,8 +501,8 @@ xname_flags(
 {
     register char *buf;
     char *obufp;
-    register int typ = obj->otyp;
-    register struct objclass *ocl = &objects[typ];
+    int typ = obj->otyp;
+    struct objclass *ocl = &objects[typ];
     int nn = ocl->oc_name_known, omndx = obj->corpsenm;
     const char *actualn = OBJ_NAME(*ocl);
     const char *dn = OBJ_DESCR(*ocl);
@@ -873,7 +873,11 @@ xname_flags(
     if (has_oname(obj) && dknown) {
         Strcat(buf, " named ");
  nameit:
+        obufp = eos(buf);
         Strcat(buf, ONAME(obj));
+        /* downcase "The" in "<quest-artifact-item> named The ..." */
+        if (obj->oartifact && !strncmp(obufp, "The ", 4))
+            *obufp = lowc(*obufp); /* = 't'; */
     }
 
     if (!strncmpi(buf, "the ", 4))