f-iring without ammo refinement

A change a couple of weeks ago to have player's chosen ammo be auto-
quivered when using the 'f' command while quiver is empty was excluding
objects with quantity 1.  That was on the basis that it was in the process
of being thrown so there was no point in putting it into the quiver slot
first.  But if it was a boomerang, or Mjollnir under suitable conditions,
there was a chance for it to be available for another throw, so there is
a point to quivering it.  Also, player can hit ESC at the direction prompt
and end up not throwing it after all.  So, put even quantity 1 items into
the quiver when 'f' command is used with empty quiver.
This commit is contained in:
nethack.rankin
2007-05-08 03:45:53 +00:00
parent 49d0204fc4
commit 82c82016cd
2 changed files with 10 additions and 7 deletions

View File

@@ -351,16 +351,19 @@ dofire()
You("have nothing appropriate for your quiver.");
}
/* if autoquiver is disabled or has failed, prompt for missile;
fill quiver with it if it's a stack that's not wielded */
fill quiver with it if it's not wielded */
if (!obj) {
obj = getobj(uslinging() ? bullets : toss_objs, "throw");
if (obj && obj->quan > 1L && !obj->owornmask &&
/* Q command doesn't allow gold in quiver */
obj->oclass != COIN_CLASS)
/* Q command doesn't allow gold in quiver */
if (obj && !obj->owornmask && obj->oclass != COIN_CLASS)
setuqwep(obj); /* demi-autoquiver */
}
/* give feedback if quiver has now been filled */
if (uquiver) prinv("You ready:", uquiver, 0L);
if (uquiver) {
uquiver->owornmask &= ~W_QUIVER; /* less verbose */
prinv("You ready:", uquiver, 0L);
uquiver->owornmask |= W_QUIVER;
}
}
return obj ? throw_obj(obj, shotlimit) : 0;