mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Loop the check for data path until valid address given.
This is to prevent people from selecting the wrong address and then wondering why the game doesn't work. Related to #1648.
This commit is contained in:
21
src/config.c
21
src/config.c
@@ -907,13 +907,22 @@ bool config_find_or_browse_install_directory()
|
||||
gConfigGeneral.game_path = malloc(strlen(path) + 1);
|
||||
safe_strcpy(gConfigGeneral.game_path, path, MAX_PATH);
|
||||
} else {
|
||||
platform_show_messagebox("Unable to find RCT2 installation directory. Please select the directory where you installed RCT2!");
|
||||
installPath = platform_open_directory_browser("Please select your RCT2 directory");
|
||||
if (installPath == NULL)
|
||||
return false;
|
||||
while (1) {
|
||||
platform_show_messagebox("Unable to find RCT2 installation directory. Please select the directory where you installed RCT2!");
|
||||
installPath = platform_open_directory_browser("Please select your RCT2 directory");
|
||||
if (installPath == NULL)
|
||||
return false;
|
||||
|
||||
SafeFree(gConfigGeneral.game_path);
|
||||
gConfigGeneral.game_path = installPath;
|
||||
SafeFree(gConfigGeneral.game_path);
|
||||
gConfigGeneral.game_path = installPath;
|
||||
|
||||
if (platform_original_game_data_exists(installPath))
|
||||
return true;
|
||||
|
||||
utf8 message[MAX_PATH] = { 0 };
|
||||
sprintf(message, "Could not find %sData%cg1.dat at this path", installPath, platform_get_path_separator());
|
||||
platform_show_messagebox(message);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user