From f7436fd02d03de7d807890a5c60717dc86e4861b Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 10 Jul 2021 19:09:17 -0700 Subject: [PATCH] fix pull request #540 - don't autoquiver aklys 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 | 4 +++- src/invent.c | 16 ++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/doc/fixes37.0 b/doc/fixes37.0 index e6eefb55a..48f059d30 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -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 diff --git a/src/invent.c b/src/invent.c index a3fb3f3f1..e0876dff3 100644 --- a/src/invent.c +++ b/src/invent.c @@ -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: -- 2.50.1