]> granicus.if.org Git - nethack/commitdiff
gold in menus fix (tty; GOLDOBJ for branch, both GOLDOBJ/!GOLDOBJ for trunk)
authornethack.rankin <nethack.rankin>
Sat, 6 Jan 2007 04:39:49 +0000 (04:39 +0000)
committernethack.rankin <nethack.rankin>
Sat, 6 Jan 2007 04:39:49 +0000 (04:39 +0000)
     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
win/tty/wintty.c

index 16b7a14295b0b3a3a3fec88a5488bf99bc03bdb4..f394ad44d41314594f4b79c14da04fe87764d16f 100644 (file)
@@ -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
index e67ba77df9056bf003621625bcb16af7178432bc..1a75f287f13e8e132d6c8c2f191e2c8b168a31fd 100644 (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                               */
 /* 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;