]> granicus.if.org Git - nethack/commitdiff
end-of-game disclosure for gold in invent on tty
authorPatR <rankin@nethack.org>
Fri, 28 Oct 2022 00:25:14 +0000 (17:25 -0700)
committerPatR <rankin@nethack.org>
Fri, 28 Oct 2022 00:25:14 +0000 (17:25 -0700)
Reported by entrez:  disclosing inventory at end of game did not show
gold.  Not mentioned:  only for tty.

It was using the same window as gets used for perm_invent (although
not shown _as_ perm_invent because end of game turns that off) and the
default for whether to show gold is different for tty than for other
interfaces due use of experimental TTYINV from player's environment.

Force the end of game inventory disclosure to work the same as the
dumplog inventory listing and use a different window, by falsely
telling display_inventory() that a response is requested.  Works but
the whole inventory mechanism has become quite convoluted.

src/end.c

index b97739a4479f6f3318d369b44e37de6355650880..0b501bd6aca5a9de5c51ebad0efe3329b9af7bf8 100644 (file)
--- a/src/end.c
+++ b/src/end.c
@@ -836,8 +836,9 @@ disclose(int how, boolean taken)
         ask = should_query_disclose_option('i', &defquery);
         c = ask ? yn_function(qbuf, ynqchars, defquery, TRUE) : defquery;
         if (c == 'y') {
-            /* caller has already ID'd everything */
-            (void) display_inventory((char *) 0, FALSE);
+            /* caller has already ID'd everything; we pass 'want_reply=True'
+               to force display_pickinv() to avoid using WIN_INVENT */
+            (void) display_inventory((char *) 0, TRUE);
             container_contents(g.invent, TRUE, TRUE, FALSE);
         }
         if (c == 'q')