interactive !pickup_types

To use 'O' to clear a value from pickup_types with menustyle Traditional
or Combination, you needed to give a value starting with 'a' (for 'all').
Accept space(s) too, similar to removing an object or monster name.
This commit is contained in:
PatR
2018-12-12 18:49:12 -08:00
parent a63b9f29a5
commit 59dcf73ad8

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 options.c $NHDT-Date: 1544396581 2018/12/09 23:03:01 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.340 $ */
/* NetHack 3.6 options.c $NHDT-Date: 1544669347 2018/12/13 02:49:07 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.343 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2008. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2986,12 +2986,17 @@ boolean tinitial, tfrom_file;
use_menu = TRUE;
if (flags.menu_style == MENU_TRADITIONAL
|| flags.menu_style == MENU_COMBINATION) {
boolean wasspace;
use_menu = FALSE;
Sprintf(qbuf, "New %s: [%s am] (%s)", fullname, ocl,
*tbuf ? tbuf : "all");
getlin(qbuf, abuf);
wasspace = (abuf[0] == ' '); /* before mungspaces */
op = mungspaces(abuf);
if (abuf[0] == '\0' || abuf[0] == '\033')
if (wasspace && !abuf[0])
; /* one or more spaces will remove old value */
else if (!abuf[0] || abuf[0] == '\033')
op = tbuf; /* restore */
else if (abuf[0] == 'm')
use_menu = TRUE;