forked from fte/fteqw
1
0
Fork 0

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:
Spoike 2009-08-29 15:09:35 +00:00
parent 38d8b7189b
commit ee25afa861
1 changed files with 4 additions and 1 deletions

View File

@ -910,6 +910,7 @@ void SV_Savegame_f (void)
char *savename;
levelcache_t *cache;
char str[MAX_LOCALINFO_STRING+1];
char *savefilename;
if (!sv.state)
{
@ -922,7 +923,9 @@ void SV_Savegame_f (void)
if (!*savename || strstr(savename, ".."))
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)
{
Con_Printf("Couldn't open file saves/%s/info.fsv\n", savename);