[comp.sources.bugs] NetHack blindfold fix

creps@silver.bacs.indiana.edu (Steve Creps) (01/01/88)

   Here is a context diff to fix the problem of being able to drop
the blindfold while wearing it (you are still blindfolded). This
fix makes it act as it does when you try to drop armor you're
wearing. It's basically the same thing that was done with the leash
code.
   I noticed that with this and the leash fix for dropping while
the item is presently applied, that if you have applied ANY blindfold/
leash, and attempt to drop ANY OTHER blindfold/leash, it won't let you.
This is because the program doesn't keep track of WHICH leash or blindfold
is applied, just that A leash or blindfold is applied. Maybe the
implementers of these features would like to correct this.
   With this patch, and the permonst save fix I just posted, I know
of no remaining bugs left in my version of PC NetHack (unless you include
what I said about leashes/blindfolds).
   The diffs are included below my .sig:

-	-	-	-	-	-	-	-	-
Steve Creps on the VAX 8650 running Ultrix 2.0-1 at Indiana University.
	creps@silver.bacs.indiana.edu
"F-14 Tomcat! There IS no substitute."


*** do.c.old	Thu Dec 31 15:32:46 1987
--- do.c	Thu Dec 31 15:31:31 1987
***************
*** 68,73
              }
          }
  #endif
  	pline("You dropped %s.", doname(obj));
  	dropx(obj);
  	return(1);

--- 68,77 -----
              }
          }
  #endif
+         if (obj->otyp == BLINDFOLD && Blindfolded) {
+         	pline("You cannot drop something you are wearing.");
+         	return(0);
+         }
  	pline("You dropped %s.", doname(obj));
  	dropx(obj);
  	return(1);