fix issue #1337 - 'fireassist' vs 'f'iring aklys

Issue reported by elunna:  if the 'fireassist' option is on and the
quiver contains ammo, 'f' while wielding an aklys switches to the
ammo's launcher instead of throwing the aklys.

Fixes #1337
This commit is contained in:
PatR
2024-12-13 12:30:48 -08:00
parent c7739171a2
commit bbb4bfa938
2 changed files with 9 additions and 4 deletions

View File

@@ -2069,6 +2069,8 @@ non-fireproof water walking boots wouldn't be burnt up if fire resistant hero
at wall locations
if a pile of objects had plain arrow(s) on top, map location classification
got confused and reported 'unexplored area'
when the 'fireassist' option was on, 'f' would choose uquiver over wielded
throw-and-return uwep
Fixes to 3.7.0-x Platform and/or Interface Problems Exposed Via git Repository

View File

@@ -472,7 +472,8 @@ dofire(void)
on its caller to make sure hero is strong enough to throw that */
boolean uwep_Throw_and_Return = (uwep && AutoReturn(uwep, uwep->owornmask)
&& (uwep->oartifact != ART_MJOLLNIR
|| ACURR(A_STR) >= STR19(25)));
|| ACURR(A_STR) >= STR19(25))),
skip_fireassist = FALSE;
int altres, res = ECMD_OK;
/*
@@ -502,6 +503,7 @@ dofire(void)
throwing Mjollnir if quiver contains daggers] */
if (uwep_Throw_and_Return && (!obj || is_ammo(obj))) {
obj = uwep;
skip_fireassist = TRUE;
} else if (!obj) {
if (!flags.autoquiver) {
@@ -550,7 +552,8 @@ dofire(void)
obj = uquiver;
}
if (uquiver && is_ammo(uquiver) && iflags.fireassist) {
if (uquiver && is_ammo(uquiver) && iflags.fireassist
&& !skip_fireassist) {
struct obj *olauncher;
if (uwep && is_pole(uwep) && could_pole_mon())
@@ -2074,7 +2077,7 @@ thitmonst(
/* ...or any special item, if you've made him angry */
|| !mon->mpeaceful) {
/* give an explanation for keeping the item only if leader is
not doing it out of anger */
not doing it out of anger */
if (mon->mpeaceful && !Deaf) {
/* just in case, identify the object so its name will
appear in the message */
@@ -2090,7 +2093,7 @@ thitmonst(
(void) mpickobj(mon, obj);
} else {
/* under normal circumstances, leader will say something and
then return the item to the hero */
then return the item to the hero */
boolean next2u = monnear(mon, u.ux, u.uy);
finish_quest(obj); /* acknowledge quest completion */