From d807436c107aae30aa5fb2070bbddce5ca7465df Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 6 Jan 2025 03:26:54 -0500 Subject: [PATCH] Windows: broken saved game restore Apparently, restoring of saved games on Windows has been broken since 1f36b98b, 'selectsaved' extension from Oct 10. That change was altering the names of the files saved on disk to a new format introduced at that time, but the game was not opening a savefile with that same name, and the restore failed. The code that renamed the savefile to match the internal name was not part of 1f36b98b, it already existed prior to the new internally-stored format. To get things functional, this commit disables the code that carries out the renaming of the on-disk savefile to match the internal name in the savefile entirely, at least for now. This relates to GitHub issue #1346 item 2. --- src/files.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/files.c b/src/files.c index 61a375007..20a25c95d 100644 --- a/src/files.c +++ b/src/files.c @@ -1300,8 +1300,10 @@ get_saved_games(void) { char *foundfile; const char *fq_save; +#if 0 const char *fq_new_save; const char *fq_old_save; +#endif char **files = 0; int i, count_failures = 0; @@ -1339,6 +1341,12 @@ get_saved_games(void) r = plname_from_file(files[i], SUPPRESS_WAITSYNCH_PERFILE); if (r) { + /* this renaming of the savefile is not compatible + * with 1f36b98b, 'selectsaved' extension from + * Oct 10, 2024. Disable the renaming for the time + * being. + */ +#if 0 /* rename file if it is not named as expected */ Strcpy(svp.plname, r); set_savefile_name(TRUE); @@ -1348,7 +1356,7 @@ get_saved_games(void) if (strcmp(fq_old_save, fq_new_save) != 0 && !file_exists(fq_new_save)) (void) rename(fq_old_save, fq_new_save); - +#endif result[j++] = r; } else { count_failures++;