From 15122d269c99891360f90a66ea7d1a77234ef5ee Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sat, 6 Jan 2007 04:39:49 +0000 Subject: [PATCH] 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. --- doc/fixes34.4 | 1 + win/tty/wintty.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 16b7a1429..f394ad44d 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -299,6 +299,7 @@ Platform- and/or Interface-Specific Fixes tty: when loading user's run-time configuration, explicitly negating one of {DEC,IBM,MAC}graphics options after enabling another of them switched 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 man page conversion tool unix,vms: allow digits after first character in name at "Who are you?" prompt diff --git a/win/tty/wintty.c b/win/tty/wintty.c index e67ba77df..1a75f287f 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -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 */ /* 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 */ 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 || gcnt[GSELIDX(curr->gselector)] == 1)) { *rp++ = curr->gselector;