From: nethack.allison Date: Mon, 1 Jul 2002 12:32:57 +0000 (+0000) Subject: Clean up win32 emergency exit handling a little X-Git-Tag: MOVE2GIT~2695 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8d0b3091cb5eecb3f10d0a905988636387ba9f29;p=nethack Clean up win32 emergency exit handling a little --- diff --git a/sys/share/pcsys.c b/sys/share/pcsys.c index 0216ace2c..78d760585 100644 --- a/sys/share/pcsys.c +++ b/sys/share/pcsys.c @@ -384,10 +384,17 @@ char *name; return; } +#ifdef WIN32 +boolean getreturn_disable; +#endif + void getreturn(str) const char *str; { +#ifdef WIN32 + if (getreturn_disable) return; +#endif #ifdef TOS msmsg("Hit %s.", str); #else diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index 5ce3950ff..1af1832d7 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -164,6 +164,8 @@ tty_end_screen() } } +extern boolean getreturn_disable; /* from sys/share/pcsys.c */ + static BOOL CtrlHandler(ctrltype) DWORD ctrltype; { @@ -174,6 +176,7 @@ DWORD ctrltype; case CTRL_CLOSE_EVENT: case CTRL_LOGOFF_EVENT: case CTRL_SHUTDOWN_EVENT: + getreturn_disable = TRUE; #ifndef NOSAVEONHANGUP hangup(0); #endif