From 64ebb9cebad63bc826736083f929675fdb9ca599 Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 25 Sep 2018 18:01:44 -0700 Subject: [PATCH] fix #7414 - bug with Japanese names for Samurai Description for use when an item hasn't been seen up close yet falls back to real name if there is no separate description, but was doing so before real name substitution for samurai. actualn = foo; dn = description ? description : actualn; if (Samurai) actualn = bar; So player saw a flail (via 'dn') until dknown bit got set, then nunchaku (via 'actualn' after it got set to samurai-specific value). Wait until after substitution of Japanese real names before falling back to real name when there's no description. --- doc/fixes36.2 | 2 ++ src/objnam.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index ef5053811..ec4b0fb95 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -144,6 +144,8 @@ shop messages refer to shk by name even when shk is not visible but some used pronoun "it" or "its" in same sentence; ditto for vault guards poly'd hero and monsters could eat through iron bars in areas where walls were flagged as non-diggable +Samurai seeing items at a distance could have them be described by their + ordinary names rather than by their Japanese names Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/objnam.c b/src/objnam.c index 46fc3d493..ce952c36f 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -403,7 +403,7 @@ unsigned cxn_flags; /* bitmask of CXN_xxx values */ register 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) ? OBJ_DESCR(*ocl) : actualn; + const char *dn = OBJ_DESCR(*ocl); const char *un = ocl->oc_uname; boolean pluralize = (obj->quan != 1L) && !(cxn_flags & CXN_SINGULAR); boolean known, dknown, bknown; @@ -411,6 +411,10 @@ unsigned cxn_flags; /* bitmask of CXN_xxx values */ buf = nextobuf() + PREFIX; /* leave room for "17 -3 " */ if (Role_if(PM_SAMURAI) && Japanese_item_name(typ)) actualn = Japanese_item_name(typ); + /* 3.6.2: this used to be part of 'dn's initialization, but it + needs to come after possibly overriding 'actualn' */ + if (!dn) + dn = actualn; buf[0] = '\0'; /* -- 2.40.0