]> granicus.if.org Git - nethack/commitdiff
ggetobj bug when dropping just gold
authorPatR <rankin@nethack.org>
Thu, 1 Oct 2020 23:16:26 +0000 (16:16 -0700)
committerPatR <rankin@nethack.org>
Thu, 1 Oct 2020 23:16:26 +0000 (16:16 -0700)
Noticed when testing something unrelated: for menustyle=traditional
and =combination, when using 'D' to drop multiple items, if the
player only supplied '$' for the list of object classes of interest
then that list remained empty and all classes were processed.
Caused by retaining an old special case for gold which isn't needed
any more.

I think that it only mattered for 'D'.  Other callers of ggetobj()
don't include gold as applicable so player can't pick gold hence
can't pick just gold to trigger this.

doc/fixes37.0
src/invent.c

index 41ec6dcb5f838d93b9030774f6c53ab9f6b4c323..4f70d8dfafbbd36501cdeaf689b121fb779ed3ca 100644 (file)
@@ -1,4 +1,4 @@
-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.315 $ $NHDT-Date: 1601547360 2020/10/01 10:16:00 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.316 $ $NHDT-Date: 1601594180 2020/10/01 23:16:20 $
 
 General Fixes and Modified Features
 -----------------------------------
@@ -264,6 +264,8 @@ when make was invoked with -j makedefs instances could end up running in
        in mdlib.c so there is no requirement to define HAS_NO_MKSTEMP there
 make piranhas faster and give them extra bite attack
 fire sources can ignite candles, lamps, and potions of oil
+for multiple drop ('D') with menustyle traditional or combination, if the only
+       object class player picked was '$' then it operated on all classes
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index e33740ace22f98f66086c25a2142abf71dea628c..126947f99322b6f69735628cbc0e9198fde101d4 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 invent.c        $NHDT-Date: 1596226443 2020/07/31 20:14:03 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.300 $ */
+/* NetHack 3.7 invent.c        $NHDT-Date: 1601594180 2020/10/01 23:16:20 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.301 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Derek S. Ray, 2015. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -2102,9 +2102,7 @@ unsigned *resultflags;
             }
         }
 
-        if (oc_of_sym == COIN_CLASS && !combo) {
-            g.context.botl = 1;
-        } else if (sym == 'a') {
+        if (sym == 'a') {
             allflag = TRUE;
         } else if (sym == 'A') {
             ; /* same as the default */
@@ -2133,11 +2131,6 @@ unsigned *resultflags;
                ? -2 : -3;
     } else if (flags.menu_style != MENU_TRADITIONAL && combo && !allflag) {
         return 0;
-#if 0
-    /* !!!! test gold dropping */
-    } else if (allowgold == 2 && !oletct) {
-        return 1; /* you dropped gold (or at least tried to)  */
-#endif
     } else {
         int cnt = askchain(&g.invent, olets, allflag, fn, ckfn, mx, word);
         /*
@@ -3232,8 +3225,7 @@ dotypeinv()
         }
     }
     if (traditional) {
-        /* collect a list of classes of objects carried, for use as a prompt
-         */
+        /* collect list of classes of objects carried, for use as a prompt */
         types[0] = 0;
         class_count = collect_obj_classes(types, g.invent, FALSE,
                                           (boolean FDECL((*), (OBJ_P))) 0,