[net.games.hack] Killing skopkeepers - actually two bug fixes

aeb@mcvax.UUCP (Andries Brouwer) (05/22/85)

In article <207@uthub.UUCP> ron@uthub.UUCP (Ron Wessels) writes:
>While I'm talking about it, there's a bug in that code, too.  If you
>do anything that overlays the screen (like reading a scroll of gold
>detection or taking inventory), only monsters that have moved are
>redrawn.  I have sent my analysis and suggested fix to aeb@mcvax with
>the request that a correct fix be posted.  Stay tuned, folks.

Yes - below a diff that probably fixes this and some other problem
with the display when you are blind.
{ Throw a tripe ration at your dog while blind & 'telepathic'; now the 'd'
  disappears. }
Of course this is not the right fix - all display routines should
be rewritten - but it improves things a tiny little bit again.

The second diff fixes a small problem in mklev: it was possible to have
secret doors that had a '+' on the level map; now one could not enter
this position until after some searching.

As a final remark: since the distribution of 1.0.2 people have reported
a relatively large number of bugs/fixes/enhancements (perhaps some 20?)
and I plan to send out an ed script that converts 1.0.2 into 1.0.3.
Thus, 1.0.3 will be essentially identical to 1.0.2 - no new features,
but it will contain a System V version of hack.tty.c.
The ed script will be about 40K. I hope people have preserved an
unadulterated copy of the 1.0.2 distribution.
I'll be abroad for three weeks and will need another week to catch up
reading mail & news, so you should expect this posting about a month
from now.

And now for the fixes.
hack.pri.c:
187a188
> 	register struct monst *mtmp;
194c195,197
< 	if(!Invis){
---
> 
> /* Some ridiculous code to get display of @ and monsters (almost) right */
> 	if(!Invis || See_invisible) {
200,202c203
< #ifdef RIDICULOUS_CODE
< 	/* %% - is this really necessary? - it causes bugs when Blind */
< 	/* declare mtmp */
---
> 	seemons();	/* reset old positions */
204,207c205,207
< 		if(mtmp->mdispl && !(room = &levl[mtmp->mx][mtmp->my])->new &&
< 		   !room->seen)
< 			mtmp->mdispl = 0;
< #endif RIDICULOUS_CODE
---
> 		mtmp->mdispl = 0;
> 	seemons();	/* force new positions to be shown */
> /* This nonsense should disappear soon --------------------------------- */
225a226,227
> 	register struct monst *mtmp;
> 
229a232,238
> 
> 	seemons();	/* reset old positions */
> 	for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
> 	    if(mtmp->mx >= xmin && mtmp->my < ymax)
> 		mtmp->mdispl = 0;
> 	seemons();	/* force new positions to be shown */
> 
385d393
< 	register struct monst *mtmp = m_at(x,y);
389,392c397
< 	if(x == u.ux && y == u.uy && !Invis)
< 		return;
< 	if(!mtmp || (mtmp->minvis && !See_invisible) ||
< 		    (mtmp->mhide && o_at(x,y))){
---
> 	if(!vism_at(x,y)) {
462,468c467,476
< vism_at(x,y) register x,y; {
< register struct monst *mtmp;
< register int csi = (See_invisible != 0);
< 	return((x == u.ux && y == u.uy && (!Invis || csi)) ? 1 :
< 		((mtmp = m_at(x,y)) && (!mtmp->minvis || csi) &&
< 			(!mtmp->mhide || !o_at(mtmp->mx,mtmp->my)))
< 		? cansee(x,y) : 0);
---
> vism_at(x,y)
> register x,y;
> {
> 	register struct monst *mtmp;
> 
> 	return((x == u.ux && y == u.uy && (!Invis || See_invisible))
> 			? 1 :
> 	       (mtmp = m_at(x,y))
> 			? ((Blind && Telepat) || canseemon(mtmp)) :
> 		0);

hack.mklev.c
***************
*** 341,346
  	register struct mkroom *broom;
  	register tmp;
  
  	levl[x][y].typ = type;
  	if(type == DOOR)
  		levl[x][y].scrsym ='+';

--- 343,350 -----
  	register struct mkroom *broom;
  	register tmp;
  
+ 	if(!IS_WALL(levl[x][y].typ))	/* avoid SDOORs with '+' as scrsym */
+ 		type = DOOR;
  	levl[x][y].typ = type;
  	if(type == DOOR)
  		levl[x][y].scrsym = '+';