mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 19:13:07 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user