artifact name formatting bit

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.
This commit is contained in:
PatR
2022-06-06 16:15:07 -07:00
parent 59c73cf0ae
commit d1d0f1103c
2 changed files with 10 additions and 4 deletions

View 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

View 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))