From 29fcdb53925922b664ba36a03c0c8e25604e9498 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Thu, 30 Apr 2020 14:49:04 +0200 Subject: [PATCH] Fix Steam RCT1 detection (#11543) --- src/openrct2/config/Config.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index e0a5e2df45..ca46558635 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -889,14 +889,13 @@ bool Csg1datPresentAtLocation(const utf8* path) std::string FindCsg1idatAtLocation(const utf8* path) { - char checkPath[MAX_PATH]; - safe_strcpy(checkPath, path, MAX_PATH); - safe_strcat_path(checkPath, "Data", MAX_PATH); - safe_strcat_path(checkPath, "CSG1I.DAT", MAX_PATH); - - // Since Linux is case sensitive (and macOS sometimes too), make sure we handle case properly. - std::string resolvedPath = Path::ResolveCasing(checkPath); - return resolvedPath; + auto result1 = Path::ResolveCasing(Path::Combine(path, "Data", "CSG1I.DAT")); + if (!result1.empty()) + { + return result1; + } + auto result2 = Path::ResolveCasing(Path::Combine(path, "RCTdeluxe_install", "Data", "CSG1I.DAT")); + return result2; } bool Csg1idatPresentAtLocation(const utf8* path)