Ensure paths exist when saving games.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3353 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
38d8b7189b
commit
ee25afa861
1 changed files with 4 additions and 1 deletions
|
@ -910,6 +910,7 @@ void SV_Savegame_f (void)
|
||||||
char *savename;
|
char *savename;
|
||||||
levelcache_t *cache;
|
levelcache_t *cache;
|
||||||
char str[MAX_LOCALINFO_STRING+1];
|
char str[MAX_LOCALINFO_STRING+1];
|
||||||
|
char *savefilename;
|
||||||
|
|
||||||
if (!sv.state)
|
if (!sv.state)
|
||||||
{
|
{
|
||||||
|
@ -922,7 +923,9 @@ void SV_Savegame_f (void)
|
||||||
if (!*savename || strstr(savename, ".."))
|
if (!*savename || strstr(savename, ".."))
|
||||||
savename = "quicksav";
|
savename = "quicksav";
|
||||||
|
|
||||||
f = FS_OpenVFS(va("saves/%s/info.fsv", savename), "wt", FS_GAMEONLY);
|
savefilename = va("saves/%s/info.fsv", savename);
|
||||||
|
FS_CreatePath(savefilename, FS_GAMEONLY);
|
||||||
|
f = FS_OpenVFS(savefilename, "wt", FS_GAMEONLY);
|
||||||
if (!f)
|
if (!f)
|
||||||
{
|
{
|
||||||
Con_Printf("Couldn't open file saves/%s/info.fsv\n", savename);
|
Con_Printf("Couldn't open file saves/%s/info.fsv\n", savename);
|
||||||
|
|
Loading…
Reference in a new issue