summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2009-01-07 22:05:13 +0000
committerSimon Howard2009-01-07 22:05:13 +0000
commit200b46f29ac8e00f909ecb381907c290b165b97e (patch)
treee651ecb5ef434ee9edacf9d68a618393f6a8c021
parented880ffdea8f9d69b2b3711785ed8cb4ac8fbec2 (diff)
downloadchocolate-doom-200b46f29ac8e00f909ecb381907c290b165b97e.tar.gz
chocolate-doom-200b46f29ac8e00f909ecb381907c290b165b97e.tar.bz2
chocolate-doom-200b46f29ac8e00f909ecb381907c290b165b97e.zip
Create the ~/.chocolate-doom/savegames directory on startup if it does
not exist. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1426
-rw-r--r--src/d_iwad.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/d_iwad.c b/src/d_iwad.c
index 032679e6..4fcaafcb 100644
--- a/src/d_iwad.c
+++ b/src/d_iwad.c
@@ -697,8 +697,13 @@ void D_SetSaveGameDir(void)
}
savegamedir = Z_Malloc(strlen(configdir) + 30, PU_STATIC, 0);
- sprintf(savegamedir, "%ssavegames%c%s%c", configdir,
- DIR_SEPARATOR, iwad_name, DIR_SEPARATOR);
+ sprintf(savegamedir, "%ssavegames%c", configdir,
+ DIR_SEPARATOR);
+
+ M_MakeDirectory(savegamedir);
+
+ sprintf(savegamedir + strlen(savegamedir), "%s%c",
+ iwad_name, DIR_SEPARATOR);
M_MakeDirectory(savegamedir);
}