]> granicus.if.org Git - nethack/commitdiff
Fix: loot regression, auto-select with justpicked
authorMichael Meyer <me@entrez.cc>
Fri, 27 May 2022 23:36:26 +0000 (19:36 -0400)
committerPatR <rankin@nethack.org>
Sat, 28 May 2022 23:56:25 +0000 (16:56 -0700)
When using 'A'/autopick with the 'items you just picked up' category,
instead of autoselecting all items within that category, it selected
every item in your inventory (like it used to work before 3.7).  Just
blew up a bag of holding because of this.

While testing the fix for that, I noticed 'P' wasn't working at all
with menustyle:traditional -- you could select it as a filter, but it
didn't actually get applied to anything, so it would end up prompting
you for every item in inventory.  Fix both those things.

src/invent.c
src/pickup.c

index 3fe7e29f51e65e3a8996ab4f8db693a48de7ba3f..75133d650a5c668fc41e810235b47092a0c0b5ce 100644 (file)
@@ -2115,7 +2115,8 @@ askchain(
     ininv = (*objchn == g.invent);
     bycat = (menu_class_present('u')
              || menu_class_present('B') || menu_class_present('U')
-             || menu_class_present('C') || menu_class_present('X'));
+             || menu_class_present('C') || menu_class_present('X')
+             || menu_class_present('P'));
 
     /* someday maybe we'll sort by 'olets' too (temporarily replace
        flags.packorder and pass SORTLOOT_PACK), but not yet... */
index 79f74ebc103e0e3406f3d015bb2f17c1ce4a1f71..0882d618dbb147973e1eff3791ed2e326e6a3fde 100644 (file)
@@ -3047,6 +3047,7 @@ menu_loot(int retry, boolean put_in)
                 loot_justpicked = TRUE;
                 count = max(0, pick_list[i].count);
                 add_valid_menu_class(pick_list[i].item.a_int);
+                loot_everything = FALSE;
             } else if (pick_list[i].item.a_int == ALL_TYPES_SELECTED) {
                 all_categories = TRUE;
             } else {