]> granicus.if.org Git - nethack/commitdiff
some special code
authornethack.allison <nethack.allison>
Sat, 26 Jan 2002 04:06:26 +0000 (04:06 +0000)
committernethack.allison <nethack.allison>
Sat, 26 Jan 2002 04:06:26 +0000 (04:06 +0000)
was added, specific to menustyle:combination in
menu_drop(), which short-circuited a redundant
prompt that <Someone> had complained about by returning
immediately if a special code came back from
ggetobj() in ggoresults.

The top of menu_drop, however, had created a
u_gold object and inserted it into the invent
chain, so you can't just return.  You have
to use a "goto" to get to drop_done, so that
the object is cleaned up.

src/do.c

index 3af8262a434157f220db103676720c44d7fc9d64..67476a450b219c93d8920883529d597ab92c18f1 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -659,8 +659,10 @@ int retry;
        /* Gather valid classes via traditional NetHack method */
        i = ggetobj("drop", drop, 0, TRUE, &ggoresults);
        if (i == -2) all_categories = TRUE;
-       if (ggoresults & ALL_FINISHED)
-               return i;
+       if (ggoresults & ALL_FINISHED) {
+               n_dropped = i;
+               goto drop_done;
+       }
     }
 
     if (drop_everything) {