xrogue: restrict changes to the save file location.
When using the -n option, disallow changing file_name or whoami via options or dialogs.
This commit is contained in:
parent
e35502804b
commit
283506baf9
2 changed files with 52 additions and 7 deletions
|
|
@ -43,7 +43,10 @@ save_game()
|
|||
mpos = 0;
|
||||
if (file_name[0] != '\0')
|
||||
{
|
||||
msg("Save file (%s)? ", file_name);
|
||||
if (use_savedir)
|
||||
msg("Save game? ");
|
||||
else
|
||||
msg("Save file (%s)? ", file_name);
|
||||
do
|
||||
{
|
||||
c = wgetch(cw);
|
||||
|
|
@ -59,6 +62,11 @@ save_game()
|
|||
else
|
||||
goto gotfile; /* must save to file restored from */
|
||||
|
||||
if (use_savedir) {
|
||||
msg("");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
msg("File name: ");
|
||||
|
|
@ -72,8 +80,11 @@ save_game()
|
|||
strcpy(file_name, buf);
|
||||
gotfile:
|
||||
|
||||
if ((savef = fopen(file_name, "wb")) == NULL)
|
||||
if ((savef = fopen(file_name, "wb")) == NULL) {
|
||||
msg(strerror(errno));
|
||||
if (use_savedir)
|
||||
return FALSE;
|
||||
}
|
||||
} while (savef == NULL);
|
||||
|
||||
msg("");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue