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.
This commit is contained in:
PatR
2020-10-01 16:16:26 -07:00
parent 1261aedd45
commit ada5ffd627
2 changed files with 6 additions and 12 deletions

View 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

View 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,