1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

fixes #1445, now checks for existance of g1.dat files in the game path rather than just for the folder

This commit is contained in:
Miso Zmiric (Mike Squinter)
2015-06-24 15:28:06 +01:00
parent 196b6b2086
commit f9d85b6959
3 changed files with 10 additions and 1 deletions

View File

@@ -713,7 +713,7 @@ static bool config_find_rct2_path(char *resultPath)
};
for (i = 0; i < countof(searchLocations); i++) {
if (platform_directory_exists(searchLocations[i]) ) {
if (platform_original_game_data_exists(searchLocations[i])) {
strcpy(resultPath, searchLocations[i]);
return true;
}

View File

@@ -87,6 +87,7 @@ void platform_stop_text_input();
char platform_get_path_separator();
int platform_file_exists(const char *path);
int platform_directory_exists(const char *path);
int platform_original_game_data_exists(const char *path);
time_t platform_file_get_modified_time(char* path);
int platform_ensure_directory_exists(const char *path);
int platform_lock_single_instance();

View File

@@ -101,6 +101,14 @@ int platform_directory_exists(const char *path)
return dwAttrib != INVALID_FILE_ATTRIBUTES && (dwAttrib & FILE_ATTRIBUTE_DIRECTORY);
}
int platform_original_game_data_exists(const char *path)
{
char checkPath[MAX_PATH];
sprintf(checkPath, "%s%c%s%c%s", path, platform_get_path_separator(), "data", platform_get_path_separator(), "g1.dat");
DWORD dwAttrib = GetFileAttributes(checkPath);
return dwAttrib != INVALID_FILE_ATTRIBUTES;
}
int platform_ensure_directory_exists(const char *path)
{
if (platform_directory_exists(path))