]> granicus.if.org Git - nethack/commitdiff
artifact name formatting
authornethack.rankin <nethack.rankin>
Sat, 17 Mar 2007 01:50:45 +0000 (01:50 +0000)
committernethack.rankin <nethack.rankin>
Sat, 17 Mar 2007 01:50:45 +0000 (01:50 +0000)
     Many (most?) non-weapon artifacts show up in inventory and messages
as "the <foo> of <bar>" 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 <the H of A>" or "a gray stone named <the H of A>" even
though it hadn't been identified yet, unintentionally hiding the artifact's
object type from the player.

doc/fixes34.4
src/objnam.c

index 8c66fc18a4726a0e91642e14bb0570ddd66107bf..e9d76c0b481383bb57e82db6a2a48568ec5933cc 100644 (file)
@@ -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
index b7b93bb48503a6d13a61c1ca5a179f3ca4e38181..2ce521d1b6af01c45bafdb641501fd2bb2a50eee 100644 (file)
@@ -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)))