[rec.games.hack] 2 Nethack 2.3 Bugs fixed

jcc@axis.fr (Jean-Christophe Collet) (06/09/88)

Hi folks,

Me again with one Bug fixed and one (maybe) misfunctionment of rings code...

	1) The doggy bug,
	   who never got the

		You stop to avoid hitting #$&^%.

	   message. (sorry if this was fixed before).
	   It comes from the test in fight.c, now it uses the mnamelth field
	   (monster name length) which must be initialized to zero in
	   makemon.c .

	2) If you're blinded (blinfolded) the ring of conflict will not work
	   anymore (can't see any reason for this, but who knows..)
	   It comes from the 'cansee' test in mon.c. cansee is a function
	   that tests if you can see a monster. So I wrote a 'cansee2' function
	   that tests if you should see a monster...

Happy hacking,
jcc

-------------------------------------------------------------------------------
jcc@axis.fr             ! "An artificial intelligence is better than none !"
..!mcvax!inria!axis!jcc ! "Artificial intelligence matches natural stupidity !"
Collet jean-christophe  ! "Objets inanimes avez vous donc une ame ?"
-------------------------------------------------------------------------------
	Axis Digital        |
	135 rue d'aguesseau |       <this space left intentionaly blank>
	92100 Boulogne      |
	France              |
-------------------------------------------------------------------------------

------ CUT HERE --- CUT HERE --- CUT HERE --- CUT HERE --- CUT HERE ------
*** fight.c.orig	Tue May 31 15:18:37 1988
--- fight.c	Tue May 31 11:21:56 1988
***************
*** 571,577
  		char *dname;		/* added by Janet Walz (walz@mimsy) */
  		mtmp->mflee = 1;
  		mtmp->mfleetim = rnd(6);
! 		if(*(dname = NAME(mtmp)))
  		    pline("You stop to avoid hitting %s.",dname);
   		else
  		    pline("You stop to avoid hitting your dog.");

--- 571,578 -----
  		char *dname;		/* added by Janet Walz (walz@mimsy) */
  		mtmp->mflee = 1;
  		mtmp->mfleetim = rnd(6);
! 		dname = NAME(mtmp);
! 		if(mtmp->mnamelth && *dname)
  		    pline("You stop to avoid hitting %s.",dname);
   		else
  		    pline("You stop to avoid hitting your dog.");
*** hack.c.orig	Thu Jun  9 14:40:15 1988
--- hack.c	Thu Jun  9 14:43:27 1988
***************
*** 821,826
  		y <= seehy) return(1);
  	return(0);
  }
  #endif /* QUEST /**/
  
  sgn(a) register int a; {

--- 821,834 -----
  		y <= seehy) return(1);
  	return(0);
  }
+ 
+ cansee2(x,y) xchar x,y; {
+ 	if(u.uswallow) return(0);
+ 	if(dist(x,y) < 3) return(1);
+ 	if(levl[x][y].lit && seelx <= x && x <= seehx && seely <= y &&
+ 		y <= seehy) return(1);
+ 	return(0);
+ }
  #endif /* QUEST /**/
  
  sgn(a) register int a; {
*** makemon.c.orig	Tue May 31 15:15:33 1988
--- makemon.c	Wed Jun  8 16:16:51 1988
***************
*** 117,122
  	fmon = mtmp;
  	mtmp->m_id = flags.ident++;
  	mtmp->data = ptr;
  	mtmp->mxlth = ptr->pxlth;
  	if(ptr->mlet == 'D') mtmp->mhpmax = mtmp->mhp = 80;
  	else if(!ptr->mlevel) mtmp->mhpmax = mtmp->mhp = rnd(4);

--- 117,123 -----
  	fmon = mtmp;
  	mtmp->m_id = flags.ident++;
  	mtmp->data = ptr;
+ 	mtmp->mnamelth = 0;
  	mtmp->mxlth = ptr->pxlth;
  	if(ptr->mlet == 'D') mtmp->mhpmax = mtmp->mhp = 80;
  	else if(!ptr->mlevel) mtmp->mhpmax = mtmp->mhp = rnd(4);
*** mon.c.orig	Mon Jun  6 11:56:04 1988
--- mon.c	Thu Jun  9 14:43:48 1988
***************
*** 99,105
  		if(mtmp->mspeed != MSLOW || !(moves%2)){
  			/* continue if the monster died fighting */
  			fr = -1;
! 			if(Conflict && cansee(mtmp->mx,mtmp->my)
  				&& (fr = fightm(mtmp)) == 2)
  				continue;
  #ifdef STOOGES

--- 103,109 -----
  		if(mtmp->mspeed != MSLOW || !(moves%2)){
  			/* continue if the monster died fighting */
  			fr = -1;
! 			if(Conflict && cansee2(mtmp->mx,mtmp->my)
  				&& (fr = fightm(mtmp)) == 2)
  				continue;
  #ifdef STOOGES