From: nethack.allison Date: Sat, 26 Jan 2002 04:06:26 +0000 (+0000) Subject: some special code X-Git-Tag: MOVE2GIT~3343 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5482d1ab747182bf39b8bec15d2432a44805bcaf;p=nethack some special code was added, specific to menustyle:combination in menu_drop(), which short-circuited a redundant prompt that 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. --- diff --git a/src/do.c b/src/do.c index 3af8262a4..67476a450 100644 --- 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) {