diff --git a/src/GameStart.cpp b/src/GameStart.cpp index 6e49db9..74158f4 100644 --- a/src/GameStart.cpp +++ b/src/GameStart.cpp @@ -42,12 +42,14 @@ std::string GetGamePath() { if (Path.empty()) { sk = R"(SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders)"; openRes = RegOpenKeyEx(HKEY_CURRENT_USER, sk, 0, KEY_ALL_ACCESS, &hKey); - if (openRes != ERROR_SUCCESS) { - fatal("Cannot get Local Appdata directory!"); - } + if (openRes == ERROR_SUCCESS) goto GotAppDataDir; + openRes = RegOpenKeyEx(HKEY_CURRENT_USER, sk.insert(51, "User "), 0, KEY_ALL_ACCESS, &hKey); + if (openRes != ERROR_SUCCESS) fatal("Cannot get Local Appdata directory"); +GotAppDataDir: Path = QueryKey(hKey, 5); Path += "\\BeamNG.drive\\"; } + std::string Ver = CheckVer(GetGameDir()); Ver = Ver.substr(0, Ver.find('.', Ver.find('.') + 1)); Path += Ver + "\\";