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.
This commit is contained in:
nhmall
2025-01-06 03:26:54 -05:00
parent 7cc118365c
commit d807436c10

View File

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