fix W343-7 - strange topten output on Windows

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.]
This commit is contained in:
nethack.rankin
2011-09-19 03:10:01 +00:00
parent 171721adda
commit ddf5aced48
6 changed files with 9 additions and 11 deletions

View File

@@ -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);

View 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},

View 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;
}

View 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 */

View 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;
}

View 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);