[comp.sources.bugs] Nethack blindness fix!

"oread::barbanis%cs.umass.edu"@RELAY.CS.NET (12/31/87)

I have hacked up a fix for the blindness bugs.  The problem was that
u.uprops was declared with 11 instead of 12 elements (happens to all
of us, right?), so that it ran into u.umconf (confuse monsters).
This was in you.h.   In apply.c, Blindfolded must be set to
INTRINSIC, not 1, because it will timeout in one move.  It did
not timeout in the original because timeout.c never got to the
BLINDFOLDED prop, since the array was declared one slot short.
Here's the patch:

*** you.h.orig	Wed Dec 30 17:15:26 1987
--- you.h	Wed Dec 30 18:43:02 1987
***************
*** 79,85
  #define	Blindfolded	u.uprops[BLINDFOLDED].p_flgs
  #define Blind		(Blinded || Blindfolded)
  #define PROP(x) (x-RIN_ADORNMENT)       /* convert ring to index in uprops */
! 	struct prop uprops[LAST_RING+11];
  
  	unsigned umconf;
  	char *usick_cause;

--- 79,85 -----
  #define	Blindfolded	u.uprops[BLINDFOLDED].p_flgs
  #define Blind		(Blinded || Blindfolded)
  #define PROP(x) (x-RIN_ADORNMENT)       /* convert ring to index in uprops */
! 	struct prop uprops[LAST_RING+12];
  
  	unsigned umconf;
  	char *usick_cause;
*** apply.c.orig	Wed Dec 30 19:02:15 1987
--- apply.c	Wed Dec 30 19:02:04 1987
***************
*** 86,92
  		    if (!Blinded)	Blinded = 1;	/* see on next move */
  		    else		pline("You still cannot see.");
  		} else {
! 		    Blindfolded = 1;
  		    seeoff(0);
  		}
  		break;

--- 86,92 -----
  		    if (!Blinded)	Blinded = 1;	/* see on next move */
  		    else		pline("You still cannot see.");
  		} else {
! 		    Blindfolded = INTRINSIC;
  		    seeoff(0);
  		}
  		break;


-----------------------------------------------------------------------------

George Barbanis
UMass - Amherst

barbanis@cs.umass.edu