gold in menus fix (tty; GOLDOBJ for branch, both GOLDOBJ/!GOLDOBJ for trunk)

A recent change to force gold in inventory (during multi-item Drop or
applying/looting containers) to have '$' for its inventory letter for the
!GOLDOBJ configuration has revealed a bug which 3.4.3 has for the GOLDOBJ
configuration.  Specifying a count followed by '$' to use a subset of
carried gold didn't work under tty; the $ was treated as a group accelator
and overrode the count, so full stack was always used.  (The code a few
lines above this which counts the occurrences of group accelators already
includes this same fix:  ignore an item's group accelator when it matches
the selector.)

     I wouldn't be surprised if other interfaces are subject to the same
problem; since I can't test those I'm not attempting to fix them blindly.
This commit is contained in:
nethack.rankin
2007-01-06 04:39:49 +00:00
parent f919f69251
commit 15122d269c
2 changed files with 4 additions and 2 deletions
+1
View File
@@ -299,6 +299,7 @@ Platform- and/or Interface-Specific Fixes
tty: when loading user's run-time configuration, explicitly negating one of tty: when loading user's run-time configuration, explicitly negating one of
{DEC,IBM,MAC}graphics options after enabling another of them switched {DEC,IBM,MAC}graphics options after enabling another of them switched
to regular ASCII and left the earlier option inaccurately set to "on" to regular ASCII and left the earlier option inaccurately set to "on"
tty+GOLDOBJ: dropping or looting by menu wouldn't honor a count for gold
unix: remove use of parentheses in nethack man page usage that confused a unix: remove use of parentheses in nethack man page usage that confused a
man page conversion tool man page conversion tool
unix,vms: allow digits after first character in name at "Who are you?" prompt unix,vms: allow digits after first character in name at "Who are you?" prompt
+3 -2
View File
@@ -1,4 +1,4 @@
/* SCCS Id: @(#)wintty.c 3.5 2006/12/11 */ /* SCCS Id: @(#)wintty.c 3.5 2007/01/05 */
/* Copyright (c) David Cohrs, 1991 */ /* Copyright (c) David Cohrs, 1991 */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1227,7 +1227,8 @@ struct WinDesc *cw;
if (n > 0) /* at least one group accelerator found */ if (n > 0) /* at least one group accelerator found */
for (rp = gacc, curr = cw->mlist; curr; curr = curr->next) for (rp = gacc, curr = cw->mlist; curr; curr = curr->next)
if (curr->gselector && !index(gacc, curr->gselector) && if (curr->gselector && curr->gselector != curr->selector &&
!index(gacc, curr->gselector) &&
(cw->how == PICK_ANY || (cw->how == PICK_ANY ||
gcnt[GSELIDX(curr->gselector)] == 1)) { gcnt[GSELIDX(curr->gselector)] == 1)) {
*rp++ = curr->gselector; *rp++ = curr->gselector;