[net.games.hack] Initial inventory unknown items bug fixed...

myers@uwmacc.UUCP (Latitudinarian Lobster) (06/24/85)

A bug that has annoyed me for awhile concerns those items in a character's
initial inventory which is unknown (potions, scrolls, wands, rings).  Notice
that if you quaff, say, a healing potion that is in your initial inventory,
and then do a `\', it will indicate that you have not yet discovered
anything!  The problem is that a field was not getting initialized to 0.
A context diff follows:

*** hack.u_init.c.old	Mon Jun 24 13:09:11 1985
--- hack.u_init.c	Mon Jun 24 13:20:27 1985
***************
*** 255,260
  	while(trop->trolet) {
  		obj = mkobj(trop->trolet);
  		obj->known = trop->trknown;
  		/* not obj->dknown = 1; - let him look at it at least once */
  		obj->cursed = 0;
  		if(obj->olet == WEAPON_SYM){

--- 255,261 -----
  	while(trop->trolet) {
  		obj = mkobj(trop->trolet);
  		obj->known = trop->trknown;
+ 		obj->dknown = 0;
  		/* not obj->dknown = 1; - let him look at it at least once */
  		obj->cursed = 0;
  		if(obj->olet == WEAPON_SYM){

myers@uwmacc.UUCP (Latitudinarian Lobster) (06/24/85)

> A bug that has annoyed me for awhile concerns those items in a character's
> initial inventory which is unknown (potions, scrolls, wands, rings).  Notice
> that if you quaff, say, a healing potion that is in your initial inventory,
> and then do a `\', it will indicate that you have not yet discovered
> anything!  The problem is that a field was not getting initialized to 0.

Oops, let me put my foot in my mouth.  It turns out that you must LOOK at
the item before you use it up in order to get credit for a discovery.  The
initialization to zero is unneccesary if you like things this way.  If
you wish to assume that the character looked at the damn things before
entering the dungeon, initialize the dknown field to 1.

jeff m

aeb@mcvax.UUCP (Andries Brouwer) (06/26/85)

In article <1242@uwmacc.UUCP> myers@uwmacc.UUCP (Latitudinarian Lobster) writes:
>A bug that has annoyed me for awhile concerns those items in a character's
>initial inventory which is unknown (potions, scrolls, wands, rings).  Notice
>that if you quaff, say, a healing potion that is in your initial inventory,
>and then do a `\', it will indicate that you have not yet discovered
>anything!  The problem is that a field was not getting initialized to 0.
>A context diff follows:
>+ 		obj->dknown = 0;
>  		/* not obj->dknown = 1; - let him look at it at least once */

Again someone who doesnt understand the source. The suggested fix
doesnt change anything, and besides, nothing is broken or in need
of a fix.
Let me explain what happens. If you have a backpack containing
some bottles with potions and you grab one at random and drink its
contents then you do not discover anything - indeed, as the comment
in the source says, you have to look at the color at least once
in order to be able to make the connection
"purple potion" = "potion of gain level".
Thus, you might start with the 'i' command; or, if you start with
the 'q' command, reply with '?' to the question "quaff what?".
When you are blind and pickup a flask it is listed as "a potion"
and you will not discover anything by drinking it either.

rick@uwmacc.UUCP (the absurdist) (07/11/85)

In article <722@mcvax.UUCP> aeb@mcvax.UUCP (Andries Brouwer) writes:
>
>Again someone who doesnt understand the source. The suggested fix
>doesnt change anything, and besides, nothing is broken or in need
>of a fix.
> ... If you have a backpack containing
>some bottles with potions and you grab one at random and drink its
>contents then you do not discover anything - indeed, as the comment
>in the source says, you have to look at the color at least once
>in order to be able to make the connection
>"purple potion" = "potion of gain level".

Well, it is Andries' game -- and it is free -- but this seems to be
a fairly petty distinction.  Why can't you assume that when you take
things out of your backpack initially you LOOK at the damn things.
For that matter, where do these backpacks full of unknown bottles
come from at the start?  A gatekeeper handing them to you on your
way in?  
	This reminds me all to much of the baroque structure of
the Dungeons & Dragons rules, where inconsistency was piled on
inconsistency with each new release ... even in fantasy games,
there should be some attempt to relate behavior to the real
world, instead of using "just because" rules.


-- 
"Grovel, you commoners!" -- Harry Flashman, V.C.
Rick Keir -- MicroComputer Information Center, MACC
1210 West Dayton St/U Wisconsin Madison/Mad WI 53706
{allegra, ihnp4, seismo}!uwvax!uwmacc!rick