Ensure user directory exists when specifying custom path

This is done anyway in openrct2.c:openrct2_initialise(), but we will
have wrong custom user data path by then.
This commit is contained in:
Michał Janiszewski committed 2016-05-27 21:43:52 +02:00
1 parent 4ba1c17b0d
commit 642bfeb44e
1 file changed
+4
+4
View File
@@ -662,6 +662,10 @@ void platform_resolve_user_data_path()
const char separator[2] = { platform_get_path_separator(), 0 };
if (gCustomUserDataPath[0] != 0) {
if (!platform_ensure_directory_exists(gCustomUserDataPath)) {
log_error("Failed to create directory \"%s\", make sure you have permissions.", gCustomUserDataPath);
return;
}
if (realpath(gCustomUserDataPath, _userDataDirectoryPath) == NULL) {
log_error("Could not resolve path \"%s\"", gCustomUserDataPath);
return;