]> granicus.if.org Git - nethack/commitdiff
fix pull request #540 - don't autoquiver aklys
authorPatR <rankin@nethack.org>
Sun, 11 Jul 2021 02:09:17 +0000 (19:09 -0700)
committerPatR <rankin@nethack.org>
Sun, 11 Jul 2021 02:09:17 +0000 (19:09 -0700)
If player throws a wielded aklys and it fails to return, and quiver
is empty when picking it back up, don't put it into that slot because
it needs to be wielded to achieve best throwing effect.  A player who
had wielded it and was using 'f' to throw it might not notice that
it isn't returning until it hasn't returned several times.  Moot if
quiver already has some missile readied.  Don't autoquiver even if
some other weapon is wielded because that might have been done just
to go retrieve the aklys.

The game doesn't keep track of whether a previously thrown item was
wielded at the time, and shouldn't be changed to auto-wield in such
situation.  Leaving quiver empty so that player is prompted for what
to throw is sufficient.

Fixes #540

doc/fixes37.0
src/invent.c

index e6eefb55a85a3a97e995f75c113b06ab3eb28309..48f059d307e6c7ec328736786758a4627f123ac8 100644 (file)
@@ -1,4 +1,4 @@
-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.591 $ $NHDT-Date: 1625962417 2021/07/11 00:13:37 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.592 $ $NHDT-Date: 1625969349 2021/07/11 02:09:09 $
 
 General Fixes and Modified Features
 -----------------------------------
@@ -740,6 +740,8 @@ correct the pluralization of monarch to monarchs, rather than monarches
 don't allow web spun by spider to interfere with solving Soloban
 fix parsing of wish adjectives (return value broken by changes accompanying
        figurine gender patch)
+when picking up a thrown weapon while quiver is empty, don't put it into the
+       quiver slot if it needs to be wielded for throw-and-return action
 
 curses: 'msg_window' option wasn't functional for curses unless the binary
        also included tty support
index a3fb3f3f10fcbc4d9e5dbb8bb5621b19970f9d83..e0876dff368755abbd8d471e44a539032866d039 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 invent.c        $NHDT-Date: 1620861205 2021/05/12 23:13:25 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.331 $ */
+/* NetHack 3.7 invent.c        $NHDT-Date: 1625969349 2021/07/11 02:09:09 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.334 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Derek S. Ray, 2015. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -924,12 +924,16 @@ addinv_core0(struct obj *obj, struct obj *other_obj,
     obj->where = OBJ_INVENT;
 
     /* fill empty quiver if obj was thrown */
-    if (flags.pickup_thrown && !uquiver && obj_was_thrown
+    if (obj_was_thrown && flags.pickup_thrown && !uquiver
         /* if Mjollnir is thrown and fails to return, we want to
-           auto-pick it when we move to its spot, but not into quiver;
-           aklyses behave like Mjollnir when thrown while wielded, but
-           we lack sufficient information here make them exceptions */
-        && obj->oartifact != ART_MJOLLNIR
+           auto-pick it when we move to its spot, but not into quiver
+           because it needs to be wielded to be re-thrown;
+           aklys likewise because player using 'f' to throw it might
+           not notice that it isn't wielded until it fails to return
+           several times; we never auto-wield, just omit from quiver
+           so that player will be prompted for what to throw and
+           possibly realize that re-wielding is necessary */
+        && obj->oartifact != ART_MJOLLNIR && obj->otyp != AKLYS
         && (throwing_weapon(obj) || is_ammo(obj)))
         setuqwep(obj);
  added: