farlook of detected objects

At the end of December, farlook was changed to use doname() instead
of xname() in order to give more information when looking at stuff
the player had already seen.  But it ended up giving away precise
stack size for mergable objects too, even if they hadn't been seen
up close.  Changing doname() to be vague when dknown wasn't set
only worked for items in particular classes; dknown is pre-set for
a lot of things.  So this changes mksobj()'s dknown handling to not
do that for stackable items.

The change to objclass.h is just comment formatting (for the first
part of the file only), provoked by the second line of the one for
oc_pre_discovered.
This commit is contained in:
PatR
2016-04-30 18:55:52 -07:00
parent 89dd37f8c7
commit 16c08f7296
4 changed files with 29 additions and 22 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mkobj.c $NHDT-Date: 1454715975 2016/02/05 23:46:15 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.119 $ */
/* NetHack 3.6 mkobj.c $NHDT-Date: 1462067745 2016/05/01 01:55:45 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.122 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -734,7 +734,8 @@ boolean artif;
otmp->where = OBJ_FREE;
otmp->dknown = index(dknowns, let) ? 0 : 1;
if ((otmp->otyp >= ELVEN_SHIELD && otmp->otyp <= ORCISH_SHIELD)
|| otmp->otyp == SHIELD_OF_REFLECTION)
|| otmp->otyp == SHIELD_OF_REFLECTION
|| objects[otmp->otyp].oc_merge)
otmp->dknown = 0;
if (!objects[otmp->otyp].oc_uses_known)
otmp->known = 1;