From: PatR Date: Sun, 10 Apr 2016 23:16:07 +0000 (-0700) Subject: getobj() ? fix X-Git-Tag: NetHack-3.6.1_RC01~838 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=221a73fe2bb19fbb17eff316e0f6f43e39cd3cba;p=nethack 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. --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 0592a4637..6240d76d8 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -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 diff --git a/src/invent.c b/src/invent.c index 1e89d406b..920ea77e0 100644 --- a/src/invent.c +++ b/src/invent.c @@ -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;