From: PatR Date: Thu, 1 Oct 2020 23:16:26 +0000 (-0700) Subject: ggetobj bug when dropping just gold X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ada5ffd627ff5834029f51c6c4c22e7706e541a7;p=nethack ggetobj bug when dropping just gold 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. --- diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 41ec6dcb5..4f70d8dfa 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -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 diff --git a/src/invent.c b/src/invent.c index e33740ace..126947f99 100644 --- a/src/invent.c +++ b/src/invent.c @@ -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,