Prevent changing name or save file when using system savedir
This commit is contained in:
parent
265ac56d38
commit
5cc5f36a58
2 changed files with 50 additions and 5 deletions
|
|
@ -51,6 +51,10 @@ save_game()
|
|||
msg("File name: %s", file_name);
|
||||
goto gotfile;
|
||||
}
|
||||
if (use_savedir)
|
||||
return FALSE;
|
||||
/* because you're not allowed to change the savefile if
|
||||
you're using the system savedir! */
|
||||
}
|
||||
|
||||
do
|
||||
|
|
@ -66,11 +70,15 @@ save_game()
|
|||
strcpy(file_name, buf);
|
||||
gotfile:
|
||||
if ((savef = fopen(file_name, "w")) == NULL)
|
||||
{
|
||||
msg(strerror(errno)); /* fake perror() */
|
||||
if (use_savedir)
|
||||
return FALSE;
|
||||
}
|
||||
} while (savef == NULL);
|
||||
|
||||
/*
|
||||
* write out encrpyted file (after a stat)
|
||||
* write out encrypted file (after a stat)
|
||||
* The fwrite is to force allocation of the buffer before the write
|
||||
*/
|
||||
if (save_file(savef) != 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue