]> granicus.if.org Git - nethack/commitdiff
fix W343-7 - strange topten output on Windows
authornethack.rankin <nethack.rankin>
Mon, 19 Sep 2011 03:10:01 +0000 (03:10 +0000)
committernethack.rankin <nethack.rankin>
Mon, 19 Sep 2011 03:10:01 +0000 (03:10 +0000)
     Move the toptenwin option from flags to iflags to keep it out of
save files, thus preventing odd behavior from win32 (nethackW.exe) when
restoring and finishing games started and saved with tty (nethack.exe).
[See cvs log entry for flag.h for more complete explanation.]

src/end.c
src/options.c
src/topten.c
sys/wince/mswproc.c
win/gem/wingem.c
win/win32/mswproc.c

index 856af8afd7d71ae7ff35e018731878f591c9a985..080353ab419273cbe886a9a70b7b21da9be1243d 100644 (file)
--- a/src/end.c
+++ b/src/end.c
@@ -1220,7 +1220,7 @@ die:
 
        /* "So when I die, the first thing I will see in Heaven is a
         * score list?" */
-       if (flags.toptenwin) {
+       if (iflags.toptenwin) {
            topten(how);
            if (have_windows)
                exit_nhwindows((char *)0);
index 49911f0f47c83c7107a9089325bf0473ccafa4ef..ba3f67113ae5cafa88da92dc7973fcdc7d690a72 100644 (file)
@@ -207,7 +207,7 @@ static struct Bool_Opt
        {"timed_delay", (boolean *)0, FALSE, SET_IN_GAME},
 #endif
        {"tombstone",&flags.tombstone, TRUE, SET_IN_GAME},
-       {"toptenwin",&flags.toptenwin, FALSE, SET_IN_GAME},
+       {"toptenwin",&iflags.toptenwin, FALSE, SET_IN_GAME},
        {"travel", &flags.travelcmd, TRUE, SET_IN_GAME},
 #ifdef UNICODE_SUPPORT
        {"unicode", &iflags.unicodedisp, FALSE, SET_IN_GAME},
index f78d341c1b2b58c195bd9b101606a02791dc288f..8acb064048d30b6a853d901597ac7b06134a020d 100644 (file)
@@ -1,5 +1,4 @@
 /* NetHack 3.5 topten.c        $Date$  $Revision$ */
-/*     SCCS Id: @(#)topten.c   3.5     2007/03/05      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -302,7 +301,7 @@ int how;
        if (program_state.panicking)
                return;
 
-       if (flags.toptenwin) {
+       if (iflags.toptenwin) {
            toptenwin = create_nhwindow(NHW_TEXT);
        }
 
@@ -551,10 +550,11 @@ int how;
        free_ttlist(tt_head);
 
   showwin:
-       if (flags.toptenwin && !done_stopprint) display_nhwindow(toptenwin, 1);
+       if (iflags.toptenwin && !done_stopprint)
+           display_nhwindow(toptenwin, 1);
   destroywin:
        if (!t0_used) dealloc_ttentry(t0);
-       if (flags.toptenwin) {
+       if (iflags.toptenwin) {
            destroy_nhwindow(toptenwin);
            toptenwin=WIN_ERR;
        }
index 64ebb0c4b547aad0ab33b3902c0bad3b12c4d578..eb9256183b4543f678427500eb81c7f08ce0a8e6 100644 (file)
@@ -180,7 +180,7 @@ void mswin_init_nhwindows(int* argc, char** argv)
         * write output to a window or stdout.  stdout doesn't make sense on Windows
         * non-console applications
         */
-       flags.toptenwin = 1;
+       iflags.toptenwin = 1;
        set_option_mod_status("toptenwin", SET_IN_FILE);
 
        /* initialize map tiles bitmap */
index 69b0790302fe2e544f7556e1d66d86c086140a99..a1635b5f0a6aa3fe545360c16812993241b08bfa 100644 (file)
@@ -1,5 +1,4 @@
 /* NetHack 3.5 wingem.c        $Date$  $Revision$ */
-/*     SCCS Id: @(#)wingem.c   3.5     1999/12/10                              */
 /* Copyright (c) Christian Bressler, 1999                                      */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -573,7 +572,7 @@ Gem_exit_nhwindows(str)
 {
        if(str) Gem_raw_print(str);
        mar_exit_nhwindows();
-       if(flags.toptenwin)
+       if(iflags.toptenwin)
                run_from_desktop=FALSE;
        iflags.window_inited = 0;
 }
index de2d6df5c80011f0f5d224b1537b64cce93590f1..d88d34015c9962f9de132d97b596473fc3c84493 100644 (file)
@@ -1,5 +1,4 @@
 /* NetHack 3.5 mswproc.c       $Date$  $Revision$ */
-/*     SCCS Id: @(#)mswproc.c  3.5     2005/01/23      */
 /* Copyright (C) 2001 by Alex Kompel    */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -218,7 +217,7 @@ void mswin_init_nhwindows(int* argc, char** argv)
         * write output to a window or stdout.  stdout doesn't make sense on Windows
         * non-console applications
         */
-       flags.toptenwin = 1;
+       iflags.toptenwin = 1;
        set_option_mod_status("toptenwin", SET_IN_FILE);
        set_option_mod_status("perm_invent", SET_IN_FILE);