monster polearm usage (trunk only)

From newsgroup discussion, reproduced with current dev code (the
missing capitalization is a post-3.4.3 buglet):

  The orc tries to wield a halberd.
  the orc's bow is welded to her hand!
  The orc thrusts a halberd.  You are almost hit by a halberd.

Caused by overloading polearm attacks with throwing.  The monster throwing
code didn't enforce that a polearm must be successfully wielded.
This commit is contained in:
nethack.rankin
2007-06-09 02:18:44 +00:00
parent 8a1d074686
commit 8dbbd1d2d0
3 changed files with 16 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)mthrowu.c 3.5 2007/03/17 */
/* SCCS Id: @(#)mthrowu.c 3.5 2007/06/07 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -499,6 +499,7 @@ struct monst *mtmp;
if (is_pole(otmp)) {
int dam, hitv;
if (otmp != MON_WEP(mtmp)) return; /* polearm must be wielded */
if (dist2(mtmp->mx, mtmp->my, mtmp->mux, mtmp->muy) > POLE_LIM ||
!couldsee(mtmp->mx, mtmp->my))
return; /* Out of range, or intervening wall */