]> granicus.if.org Git - nethack/commitdiff
bad weapon check for monster multi-shot shooting
authorPatR <rankin@nethack.org>
Wed, 31 Jul 2019 21:22:09 +0000 (14:22 -0700)
committerPatR <rankin@nethack.org>
Wed, 31 Jul 2019 21:22:09 +0000 (14:22 -0700)
A typo caused the bow and arrow check when a monster was wielding an
elven box to test the hero's weapon with monster's ammo.  [I looked
at the old slash'em code where I think this came from and it doesn't
have the typo but does have a different bug.  A monster could get a
multi-shot volley by wielding an elven bow when throwing darts or
spears.  The extra bow and arrow check is intended to prevent that.
The typo was probably by me but I have no memory of that code....]

Elves with bows (or other monsters who manage to pick up and wield an
elven bow) will shoot bigger volleys after this fix.  That will make
them more dangerous but also cause them to run out of arrows more
quickly.

doc/fixes36.3
src/mthrowu.c

index 1eeb0de1b12240e58ea899a44827f787067953d2..2ff46966ac1a8382313635e4e98c05e2c256cdbc 100644 (file)
@@ -1,4 +1,4 @@
-$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.96 $ $NHDT-Date: 1564532667 2019/07/31 00:24:27 $
+$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.97 $ $NHDT-Date: 1564608120 2019/07/31 21:22:00 $
 
 This fixes36.3 file is here to capture information about updates in the 3.6.x
 lineage following the release of 3.6.2 in May 2019. Please note, however,
@@ -110,6 +110,8 @@ add some additional validation checks when setting up a new timer (triggered
 if a chaotic monk or wizard gets crowned and is given a spellbook rather than
        Stormbringer as the crowning gift, don't describe the hero as having
        been "chosen to steal souls for [Arioch's] glory"
+for multi-shot shooting by monsters, a typo checked hero's weapon for
+       compatibility with ammo when monster was wielding an elven bow
 
 
 Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository
index d10d2f1f10140ecbe404b33c198da9175d636a8e..7cb178ed486bef280cd70e71a04670f12ff9ff31 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 mthrowu.c       $NHDT-Date: 1542765360 2018/11/21 01:56:00 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.78 $ */
+/* NetHack 3.6 mthrowu.c       $NHDT-Date: 1564608121 2019/07/31 21:22:01 $  $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.84 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Pasi Kallinen, 2016. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -183,7 +183,10 @@ struct obj *otmp, *mwep;
         /* Elven Craftsmanship makes for light, quick bows */
         if (otmp->otyp == ELVEN_ARROW && !otmp->cursed)
             multishot++;
-        if (ammo_and_launcher(otmp, uwep) && mwep->otyp == ELVEN_BOW
+        /* for arrow, we checked bow&arrow at start of block, but for
+           bow, so far we've only validated that otmp is a weapon stack;
+           need to verify that it's a stack of arrows rather than darts */
+        if (mwep->otyp == ELVEN_BOW && ammo_and_launcher(otmp, mwep)
             && !mwep->cursed)
             multishot++;
         /* 1/3 of launcher enchantment */