[rec.games.hack] Yet another Nethack 2.3 bugfix

hartl@lan.informatik.tu-muenchen.dbp.de (Anton Hartl) (08/12/88)

Nethack Bug Fixes for zap.c
===========================

1) Zapping a wand of cancellation at yourself causes obj->spe of *all* items
   to be set to -1; that's right for wands, but not for anything else.
   For example:
	wand of fire (5) -> wand of fire (-1) [i.e. unusable]
	cursed -4 ring mail -> cursed -1 ring mail [should be +0]
	+4 katana -> -1 katana [should be +0]

2) Zapping a wand of undead turning on a dead green/yellow/... dragon
   revive()s a random coloured dragon instead of a corresponding coloured one.
   (Line numbers are valid if you have already applied JC Collet's dragon
   patch).


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Franz "Oin" Schmausser
	schmauss@lan.informatik.tu-muenchen.dbp.de
	schmauss%lan.informatik.tu-muenchen.dbp.de@{relay.cs.net,unido.uucp}

Life is hard but cruel & sometimes it ends with the death.
-------------------------------------------------------------------------------
Anton "Ulysses" Hartl
	hartl@tumult.informatik.tu-muenchen.de (ARPA)
	...{!uunet,!unido}!tumult!hartl (UUCP)

Don't tell me about life.	- Marvin, the paranoid android
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dept. of Computer Science, Technical University of Munich, Bavaria




---- snip ----- snip ----- snip ----- snip ----- snip ----- snip ----- snip ---

*** zap.c.orig	Wed Jul 20 12:07:10 1988
--- zap.c	Fri Aug 12 13:35:16 1988
***************
*** 371,377
  #endif
  		    for(otmp = invent; otmp; otmp = otmp->nobj)
  		       if(otmp != uball && otmp->otyp != AMULET_OF_YENDOR)
! 			    otmp->spe = (obj->olet == WAND_SYM) ? -1 : 0;
  		    if(u.mtimedone) rehumanize();
  		    flags.botl = 1;  /* because of potential AC change */
  		    find_ac();

--- 371,377 -----
  #endif
  		    for(otmp = invent; otmp; otmp = otmp->nobj)
  		       if(otmp != uball && otmp->otyp != AMULET_OF_YENDOR)
! 			    otmp->spe = (otmp->olet == WAND_SYM) ? -1 : 0;
  		    if(u.mtimedone) rehumanize();
  		    flags.botl = 1;  /* because of potential AC change */
  		    find_ac();
***************
*** 1040,1045
  		}
  #endif /* KAA */
  #endif /* DRAGONS */
  	}
  	return(!!mtmp);		/* TRUE if some monster created */
  }

--- 1039,1092 -----
  		}
  #endif /* KAA */
  #endif /* DRAGONS */
+ 		if (mtmp)
+ 		{
+ 			extern struct permonst	grey_dragon,
+ 						red_dragon,
+ 						orange_dragon,
+ 						white_dragon,
+ 						black_dragon,
+ 						blue_dragon,
+ 						green_dragon,
+ 						yellow_dragon;
+ 			switch (obj->otyp)
+ 			{
+ 			case DEAD_GREY_DRAGON :
+ 				mtmp->dragon = 0;
+ 				mtmp->data = &grey_dragon;
+ 				break;
+ 			case DEAD_RED_DRAGON :
+ 				mtmp->dragon = 1;
+ 				mtmp->data = &red_dragon;
+ 				break;
+ 			case DEAD_ORANGE_DRAGON :
+ 				mtmp->dragon = 2;
+ 				mtmp->data = &orange_dragon;
+ 				break;
+ 			case DEAD_WHITE_DRAGON :
+ 				mtmp->dragon = 3;
+ 				mtmp->data = &white_dragon;
+ 				break;
+ 			case DEAD_BLACK_DRAGON :
+ 				mtmp->dragon = 4;
+ 				mtmp->data = &black_dragon;
+ 				break;
+ 			case DEAD_BLUE_DRAGON :
+ 				mtmp->dragon = 5;
+ 				mtmp->data = &blue_dragon;
+ 				break;
+ 			case DEAD_GREEN_DRAGON :
+ 				mtmp->dragon = 6;
+ 				mtmp->data = &green_dragon;
+ 				break;
+ 			case DEAD_YELLOW_DRAGON :
+ 				mtmp->dragon = 7;
+ 				mtmp->data = &yellow_dragon;
+ 				break;
+ 			default:
+ 				break;
+ 			}
+ 		}
  	}
  	return(!!mtmp);		/* TRUE if some monster created */
  }