]> granicus.if.org Git - nethack/commit
fix B17005 - autoquiver bug
authornethack.rankin <nethack.rankin>
Sat, 25 Jan 2003 04:46:11 +0000 (04:46 +0000)
committernethack.rankin <nethack.rankin>
Sat, 25 Jan 2003 04:46:11 +0000 (04:46 +0000)
commitb9f9a6415b3f9044ae00af53c9a62ff970f08cfc
tree087269adecc8c89722b055bdb6d9d8d822eb26ec
parent2895d27cf52dc86f72db513fa088f6153de4525e
fix B17005 - autoquiver bug

     hold_another_object() will try to quiver the object being held if
it's a weapon (or gem/rock ammo) and the autoquiver option is enabled and
the quiver is empty.  It was doing that even if the object had just merged
with primary or secondary weapon, resulting in it being equipped in two
slots at once.  (Easiest way to reproduce it is via wish+wield+wish for
similar item, but it could also occur when stealing while in nymph form.)

     This also addresses one of the old items on <Someone>'s list:  if you
carry a sling equipped in the alternate weapon slot, include gems and
rocks as likely candidates for quivering same as when wielding a sling.
This extends that to autoquivering; ammo appropriate for your alternate
is now given preference over arbitrary weapons (ammo for your wielded
weapon and arbitrary missiles still take precedence over alternate ammo).

     Bug?  pickup_object() is not autoquiver aware, hence autopickup isn't
either.

     Bug too (perhaps moot if the above is changed)?  Snagging a monster's
weapon with a bullwhip uses hold_another_object() so possibly autoquivers;
snagging an object off the floor with a grappling hook uses pickup_object()
so doesn't.
doc/fixes34.1
src/dothrow.c
src/invent.c
src/wield.c