getobj() ? fix

The "sortloot revamp" patch six or seven weeks ago broke filtering
for '?' menu in display_pickinv() called by getobj().  The old code
handled 'lets' when building an array of object pointers to be
sorted.  The revamp code did away with that to sort the linked list
instead, but neglected to put 'lets' handling into the subsequent
menu creation loop which is now operating on full invent rather
than the filtered subset.
This commit is contained in:
PatR
2016-04-10 16:16:07 -07:00
parent 65b9429b60
commit 221a73fe2b
2 changed files with 9 additions and 3 deletions

View File

@@ -206,6 +206,8 @@ when attacking a monster with a rust or corrosion or acid passive
post-3.6.0: fix "object lost" panic during pickup caused by sortloot revamp
post-3.6.0: more sortloot revisions
post-3.6.0: fix inventory menu for response of '?' to getobj (more sortloot
revamp fallout)
Platform- and/or Interface-Specific Fixes

View File

@@ -1334,10 +1334,12 @@ register const char *let, *word;
else if (!strcmp(word, "write with"))
Sprintf(qbuf, "your %s", body_part(FINGERTIP));
else if (!strcmp(word, "wield"))
Sprintf(qbuf, "your %s %s", uarmg ? "gloved" : "bare",
makeplural(body_part(HAND)));
Sprintf(qbuf, "your %s %s%s", uarmg ? "gloved" : "bare",
makeplural(body_part(HAND)),
!uwep ? " (wielded)" : "");
else if (!strcmp(word, "ready"))
Strcpy(qbuf, "empty quiver");
Sprintf(qbuf, "empty quiver%s",
!uquiver ? " (nothing readied)" : "");
if (ilet == '?' && !*lets && *altlets)
allowed_choices = altlets;
@@ -2232,6 +2234,8 @@ long *out_cnt;
nextclass:
classcount = 0;
for (otmp = invent; otmp; otmp = otmp->nobj) {
if (lets && !index(lets, otmp->invlet))
continue;
if (!flags.sortpack || otmp->oclass == *invlet) {
any = zeroany; /* all bits zero */
ilet = otmp->invlet;