From 070730d8459ab7286ce10be9be9557490b8d73be Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 17 Aug 2025 01:33:24 -0400 Subject: [PATCH] Qt6 wasn't exiting as expected after saving the game Reported by email to devteam on Feb 1, 2025. --- include/hack.h | 1 + src/save.c | 1 + win/Qt/qt_bind.cpp | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/include/hack.h b/include/hack.h index 99eaca753..361b95cd3 100644 --- a/include/hack.h +++ b/include/hack.h @@ -801,6 +801,7 @@ struct sinfo { int in_sanity_check; /* for impossible() during sanity checking */ int config_error_ready; /* config_error_add is ready, available */ int beyond_savefile_load; /* set when past savefile loading */ + int savefile_completed; /* savefile has completed writing */ #ifdef PANICLOG int in_paniclog; /* writing a panicloc entry */ #endif diff --git a/src/save.c b/src/save.c index aa9e32c3d..9dc8a3f7b 100644 --- a/src/save.c +++ b/src/save.c @@ -54,6 +54,7 @@ dosave(void) program_state.done_hup = 0; #endif if (dosave0()) { + program_state.savefile_completed++; u.uhp = -1; /* universal game's over indicator */ if (soundprocs.sound_exit_nhsound) (*soundprocs.sound_exit_nhsound)("dosave"); diff --git a/win/Qt/qt_bind.cpp b/win/Qt/qt_bind.cpp index 75a3620c1..58dc96476 100644 --- a/win/Qt/qt_bind.cpp +++ b/win/Qt/qt_bind.cpp @@ -724,6 +724,10 @@ char NetHackQtBind::qt_more() int complain = 0; do { ch = NetHackQtBind::qt_nhgetch(); + if (::program_state.savefile_completed) { + retry = false; + break; + } switch (ch) { case '\0': // hypothetical ch = '\033';