diff -cr ../nethack-3.3.1/include/hack.h ./include/hack.h *** ../nethack-3.3.1/include/hack.h Fri Sep 22 16:32:02 2000 --- ./include/hack.h Fri Sep 22 14:24:47 2000 *************** *** 141,146 **** --- 141,147 ---- #define ALL_TYPES 0x10 #define BILLED_TYPES 0x20 #define CHOOSE_ALL 0x40 + #define BUC_UNKNOWN 0x80 #define ALL_TYPES_SELECTED -2 /* Flags to control find_mid() */ diff -cr ../nethack-3.3.1/src/do.c ./src/do.c *** ../nethack-3.3.1/src/do.c Fri Sep 22 16:32:02 2000 --- ./src/do.c Fri Sep 22 15:05:43 2000 *************** *** 553,558 **** --- 553,559 ---- menu_item *pick_list; boolean all_categories = TRUE; boolean drop_everything = FALSE; + boolean drop_buc_unknown = FALSE; if (u.ugold) { /* Hack: gold is not in the inventory, so make a gold object *************** *** 570,576 **** all_categories = FALSE; n = query_category("Drop what type of items?", invent, ! UNPAID_TYPES | ALL_TYPES | CHOOSE_ALL, &pick_list, PICK_ANY); if (!n) goto drop_done; for (i = 0; i < n; i++) { --- 571,577 ---- all_categories = FALSE; n = query_category("Drop what type of items?", invent, ! UNPAID_TYPES | ALL_TYPES | CHOOSE_ALL | BUC_UNKNOWN, &pick_list, PICK_ANY); if (!n) goto drop_done; for (i = 0; i < n; i++) { *************** *** 578,583 **** --- 579,586 ---- all_categories = TRUE; else if (pick_list[i].item.a_int == 'A') drop_everything = TRUE; + else if (pick_list[i].item.a_int == 'B') + drop_buc_unknown = TRUE; else add_valid_menu_class(pick_list[i].item.a_int); } *************** *** 593,598 **** --- 596,606 ---- for(otmp = invent; otmp; otmp = otmp2) { otmp2 = otmp->nobj; n_dropped += drop(otmp); + } + } else if (drop_buc_unknown) { + for(otmp = invent; otmp; otmp = otmp2) { + otmp2 = otmp->nobj; + if (!otmp->bknown) n_dropped += drop(otmp); } } else { /* should coordinate with perm invent, maybe not show worn items */ diff -cr ../nethack-3.3.1/src/invent.c ./src/invent.c *** ../nethack-3.3.1/src/invent.c Fri Sep 22 16:32:02 2000 --- ./src/invent.c Fri Sep 22 16:20:18 2000 *************** *** 1525,1530 **** --- 1525,1547 ---- return count; } + /* + * Returns the number of items with b/u/c unknown within the given list. + * This does NOT include contained objects. + */ + int + count_buc_unknown(list) + struct obj *list; + { + int count = 0; + + while (list) { + if (!(list->bknown)) count++; + list = list->nobj; + } + return count; + } + STATIC_OVL void dounpaid() { diff -cr ../nethack-3.3.1/src/pickup.c ./src/pickup.c *** ../nethack-3.3.1/src/pickup.c Fri Sep 22 16:32:03 2000 --- ./src/pickup.c Fri Sep 22 16:31:18 2000 *************** *** 662,675 **** char invlet; int ccount; boolean do_unpaid = FALSE; *pick_list = (menu_item *) 0; if (!olist) return 0; if ((qflags & UNPAID_TYPES) && count_unpaid(olist)) do_unpaid = TRUE; ccount = count_categories(olist, qflags); /* no point in actually showing a menu for a single category */ ! if (ccount == 1 && !do_unpaid && !(qflags & BILLED_TYPES)) { for (curr = olist; curr; curr = FOLLOW(curr, qflags)) { if ((qflags & WORN_TYPES) && !(curr->owornmask & (W_ARMOR|W_RING|W_AMUL|W_TOOL|W_WEP|W_SWAPWEP|W_QUIVER))) --- 662,677 ---- char invlet; int ccount; boolean do_unpaid = FALSE; + boolean do_buc_unknown = FALSE; *pick_list = (menu_item *) 0; if (!olist) return 0; if ((qflags & UNPAID_TYPES) && count_unpaid(olist)) do_unpaid = TRUE; + if ((qflags & BUC_UNKNOWN) && count_buc_unknown(olist)) do_buc_unknown = TRUE; ccount = count_categories(olist, qflags); /* no point in actually showing a menu for a single category */ ! if (ccount == 1 && !do_unpaid && !do_buc_unknown && !(qflags & BILLED_TYPES)) { for (curr = olist; curr; curr = FOLLOW(curr, qflags)) { if ((qflags & WORN_TYPES) && !(curr->owornmask & (W_ARMOR|W_RING|W_AMUL|W_TOOL|W_WEP|W_SWAPWEP|W_QUIVER))) *************** *** 750,755 **** --- 752,765 ---- (qflags & WORN_TYPES) ? "Auto-select every item being worn" : "Auto-select every item", MENU_UNSELECTED); + } + /* items with b/u/c unknown if there are any */ + if (do_buc_unknown) { + invlet = 'B'; + any.a_void = 0; + any.a_int = 'B'; + add_menu(win, NO_GLYPH, &any, invlet, 0, ATR_NONE, + "b/u/c unknown", MENU_UNSELECTED); } end_menu(win, qstr); n = select_menu(win, how, pick_list);