From e16a078655429ac3c5103da61ac75220ad45f47d Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sat, 17 Mar 2007 01:50:45 +0000 Subject: [PATCH] artifact name formatting Many (most?) non-weapon artifacts show up in inventory and messages as "the of " even when their underlying object type hasn't been discovered yet. For types which don't use the `known' bit, obj->known is forced to 1; obj_is_pname() checked that but not the oc_name_known flag for the type. So you'd see things like "the Heart of Ahriman" instead of "a luckstone named " or "a gray stone named " even though it hadn't been identified yet, unintentionally hiding the artifact's object type from the player. --- doc/fixes34.4 | 3 ++- src/objnam.c | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 8c66fc18a..e9d76c0b4 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -340,7 +340,7 @@ towel equipped in weapon, alternate weapon, or quiver slot can be applied lit candle or potion of oil which burned out while equipped would leave stale weapon/alternate-weapon/quiver pointer that could cause panic or crash wielded/worn figurine which auto-transformed had same stale pointer bug -familiars are now created without any starting inventory +format names of not yet id'd artifacts such that obj type shows for non-weapons Platform- and/or Interface-Specific Fixes @@ -379,6 +379,7 @@ support ^R (and ^L in numpad mode) to request display repaint during direction intelligent pets will use keys to unlock doors destroyed drawbridge leaves some iron chains give feedback when a nearby monster grows into a stronger form +familiars are now created without any starting inventory Platform- and/or Interface-Specific New Features diff --git a/src/objnam.c b/src/objnam.c index b7b93bb48..2ce521d1b 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -180,11 +180,11 @@ boolean obj_is_pname(obj) register struct obj *obj; { - return((boolean)( - ((obj->dknown && obj->known) || iflags.override_ID) && has_oname(obj) && - /* Since there aren't any objects which are both - artifacts and unique, the last check is redundant. */ - obj->oartifact && !objects[obj->otyp].oc_unique)); + if (!obj->oartifact || !has_oname(obj)) return FALSE; + if (!program_state.gameover && !iflags.override_ID) { + if (not_fully_identified(obj)) return FALSE; + } + return TRUE; } @@ -905,7 +905,7 @@ register struct obj *otmp; #else !otmp->bknown || #endif - !objects[otmp->otyp].oc_name_known) /* ?redundant? */ + !objects[otmp->otyp].oc_name_known) return TRUE; if ((!otmp->cknown && (Is_container(otmp) || otmp->otyp == STATUE)) || (!otmp->lknown && Is_box(otmp)))