[net.games.hack] Bug in dart throwing

jgp@moscom.UUCP (Jim Prescott) (12/07/85)

The following is a bugfix for dart throwing.  Without this fix when you
throw a dart you lose it's magical bonuses and suffer an additional -4
penalty to hit.  The problem is that darts are falling into the same code
that matches bows with arrows, bolts with crossbows etc.  The whistle is
the next object defined after the weapons.

The patch to do.c fixes the bug and the patch to objects.h corrects a
the comment describing the codes action.

*** do.c.orig	Fri Dec  6 20:39:57 1985
--- do.c	Fri Dec  6 21:36:20 1985
***************
*** 331,337
  
  		if(obj->olet == WEAPON_SYM) {
  			tmp = -1+u.ulevel+mon->data->ac+abon();
! 			if(obj->otyp < ROCK) {
  				if(!uwep ||
  				    uwep->otyp != obj->otyp+(BOW-ARROW))
  					tmp -= 4;

--- 331,337 -----
  
  		if(obj->olet == WEAPON_SYM) {
  			tmp = -1+u.ulevel+mon->data->ac+abon();
! 			if(obj->otyp < DART) {
  				if(!uwep ||
  				    uwep->otyp != obj->otyp+(BOW-ARROW))
  					tmp -= 4;
*** objects.h.orig	Fri Dec  6 20:40:10 1985
--- objects.h	Fri Dec  6 21:35:57 1985
***************
*** 97,103
  	FOOD("dead zruty",	0, 6, 60, 600),
  
  /* weapons ... - ROCK come several at a time */
! /* weapons ... - (ROCK-1) are shot using idem+(BOW-ARROW) */
  /* weapons AXE, SWORD, THSWORD are good for worm-cutting */
  /* weapons (PICK-)AXE, DAGGER, CRYSKNIFE are good for tin-opening */
  #define WEAPON(name,prob,wt,ldam,sdam)	{ name, NULL, NULL, 1, 0 /*%%*/,\

--- 97,103 -----
  	FOOD("dead zruty",	0, 6, 60, 600),
  
  /* weapons ... - ROCK come several at a time */
! /* weapons ... - (DART-1) are shot using idem+(BOW-ARROW) */
  /* weapons AXE, SWORD, THSWORD are good for worm-cutting */
  /* weapons (PICK-)AXE, DAGGER, CRYSKNIFE are good for tin-opening */
  #define WEAPON(name,prob,wt,ldam,sdam)	{ name, NULL, NULL, 1, 0 /*%%*/,\
-- 
					Jim Prescott
			rochester!moscom!jgp or moscom!jgp@rochester