]> granicus.if.org Git - nethack/commitdiff
B08020 - partial fix for D<count>$ behavior
authorcohrs <cohrs>
Wed, 21 Aug 2002 16:57:21 +0000 (16:57 +0000)
committercohrs <cohrs>
Wed, 21 Aug 2002 16:57:21 +0000 (16:57 +0000)
When GOLDOBJ is defined, dropping partial amounts of gold using the D
command would not work because gold currently has the same inventory letter
as the coin group accelerator.  In this case, the group accelerator should
not be used, since it confuses counts.  tty and X11 ports are fixed.  The
tty change should fix the Windows console version as well (untested).

win/X11/winmenu.c
win/tty/wintty.c

index d6f80e94babbbe00889debec29e916b18e1d30e1..0d2640f06249a54b7a0e8f044de7beced97643c3 100644 (file)
@@ -713,7 +713,10 @@ X11_select_menu(window, how, menu_list)
 
        for (i = 0; i < SIZE(gcnt); i++) gcnt[i] = 0;
        for (n = 0, curr = menu_info->new_menu.base; curr; curr = curr->next)
-           if (curr->gselector) ++n,  ++gcnt[GSELIDX(curr->gselector)];
+           if (curr->gselector && curr->gselector != curr->selector) {
+               ++n;
+               ++gcnt[GSELIDX(curr->gselector)];
+           }
 
        if (n > 0)      /* at least one group accelerator found */
            for (ap = gacc, curr = menu_info->new_menu.base;
index 560f9abc8105c728f405046c05932b6fcc85ae86..a0a064a09a43aae64e27e166cd5611d837269114 100644 (file)
@@ -1156,7 +1156,10 @@ struct WinDesc *cw;
 
        for (i = 0; i < SIZE(gcnt); i++) gcnt[i] = 0;
        for (n = 0, curr = cw->mlist; curr; curr = curr->next)
-           if (curr->gselector) ++n,  ++gcnt[GSELIDX(curr->gselector)];
+           if (curr->gselector && curr->gselector != curr->selector) {
+               ++n;
+               ++gcnt[GSELIDX(curr->gselector)];
+           }
 
        if (n > 0)      /* at least one group accelerator found */
            for (rp = gacc, curr = cw->mlist; curr; curr = curr->next)