pickup into quiver

Despite lack of feedback from the beta testers about it, add the code
which tries to stack an object being added to inventory with the quiver
before trying with other carried objects.  Only matters to user if quiver
is non-empty and one or more other slot(s) are compatible with it, but
that's not uncommon for someone who starts a rogue by splitting the initial
daggers into separate wield and throw slots.  Firing a dagger from quiver
and then having it merge with wielded weapon instead of back into quiver
when picked back up leads to tedious inventory manipulation.  Assigning
different names to the two stacks solves this, but can't help when picking
up an unnamed item which is otherwise compatible.  (A rogue with starting
daggers wouldn't encounter that since unnamed ones won't be sufficiently
identified to stack, but any character who just gathers unID'd daggers and
uses them for both melee and throwing has a chance of running into the
"picked up into less desireable slot" trap whenever new ones are found.)
This commit is contained in:
nethack.rankin
2004-11-06 01:19:25 +00:00
parent aa58ee1ab7
commit c090c74eec
2 changed files with 9 additions and 0 deletions

View File

@@ -77,6 +77,8 @@ General New Features
--------------------
when you're teetering on the edge of a pit you can use '>' to enter the pit
when asked for a direction, a response of '?' yields help and then asks again
when adding an item to inventory, try to stack it with the quiver slot
before trying against other carried objects
Platform- and/or Interface-Specific New Features

View File

@@ -305,6 +305,13 @@ struct obj *obj;
return obj;
#endif
/* merge with quiver in preference to any other inventory slot
in case quiver and wielded weapon are both eligible; adding
extra to quivered stack is more useful than to wielded one */
if (uquiver && merged(&uquiver, &obj)) {
obj = uquiver;
goto added;
}
/* merge if possible; find end of chain in the process */
for (prev = 0, otmp = invent; otmp; prev = otmp, otmp = otmp->nobj)
if (merged(&otmp, &obj)) {