fix B12001 - ?--More--single line menu

From a bug report:
3.4.0 broke the ability to pick the only listed inventory letter when
user typed '?' during object selection and one candidate was listed on
the top line followed by --More--.

What do you want to throw? [b or ?*] ?
b - 7 +0 daggers (alternate weapon; not wielded).--More--b
<behaved as if user hit ESC instead of 'b' but didn't say "Never mind.">

(Dismissing --More-- the normal way and getting a new selection prompt
worked as usual.)  The problem was caused by changes in getobj's count
handling; the message_menu() routine isn't able to handle counts but
display_pickinv left the count as 0 while caller expects -1 for "count
not specified".

     This was a core bug but I put the fixes entry under "tty" since
no other interfaces are affected.
This commit is contained in:
nethack.rankin
2002-09-17 06:35:49 +00:00
parent ffb22245a9
commit 651e886d66
2 changed files with 11 additions and 9 deletions

View File

@@ -275,22 +275,23 @@ win32tty: respond only to mouse clicks not mouse movement
win32tty: allow ^C to abort the game at the "Who are you?" prompt
win32tty: fix truncated score list
win32tty: prevent ALT+CTRL from sending NUL to core with the meta bit set
X11: restore support for non-square tiles when USE_XPM is defined
Gnome: add support for non-square tiles
tty: remove #define DEBUG that forced debug behavior in production builds
X11: getlin dialog got steadily narrower each time it was used
unix: install recover command into GAMEDIR by default
tty: correctly handle an empty TERM environment variable
tty: don't lose messages when ESC has canceled their display
tty: clear topl after pickup_burden prompt
Gnome: destroy main game windows correctly
Gnome: Dylan Alex Simon's port of KDE-style worn window
Gnome: Dylan Alex Simon's port of KDE-style hero cursor color
tty: support terms where turning off inverse video turns off color too
Gnome/Linux: more portable getres*id workaround
X11: restore support for non-square tiles when USE_XPM is defined
X11: getlin dialog got steadily narrower each time it was used
msdos: compiling without NO_TERMS resulted in a link-time error
msdos: reworked Makefile.GCC to get rid of need to duplicate source files
msdos,win32: stop doing chdir when NOCWD_ASSUMPTIONS is defined
tty: remove #define DEBUG that forced debug behavior in production builds
tty: correctly handle an empty TERM environment variable
tty: don't lose messages when ESC has canceled their display
tty: clear topl after pickup_burden prompt
tty: support terms where turning off inverse video turns off color too
tty: object selection at --More-- prompt after '?' didn't work anymore
unix: install recover command into GAMEDIR by default
vms: prevent error() from indirectly triggering hangup save during forced exit

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)invent.c 3.4 2002/04/07 */
/* SCCS Id: @(#)invent.c 3.4 2002/09/16 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1677,6 +1677,7 @@ long* out_cnt;
ret = message_menu(lets[0],
want_reply ? PICK_ONE : PICK_NONE,
xprname(otmp, (char *)0, lets[0], TRUE, 0L, 0L));
if (out_cnt) *out_cnt = -1L; /* select all */
break;
}
}