Try to find a steam install for the base path

This commit is contained in:
dhewg 2012-07-06 19:43:20 +02:00
parent 2052928433
commit 390b6a493d

View file

@ -346,12 +346,21 @@ bool Sys_GetPath(sysPath_t type, idStr &path) {
common->Warning("base path '%s' does not exits", s.c_str()); common->Warning("base path '%s' does not exits", s.c_str());
} }
// fallback to vanilla doom3 install // fallback to vanilla doom3 cd install
if (GetRegistryPath(buf, sizeof(buf), L"SOFTWARE\\id\\Doom 3", L"InstallPath") > 0) { if (GetRegistryPath(buf, sizeof(buf), L"SOFTWARE\\id\\Doom 3", L"InstallPath") > 0) {
path = buf; path = buf;
return true; return true;
} }
// fallback to steam doom3 install
if (GetRegistryPath(buf, sizeof(buf), L"SOFTWARE\\Valve\\Steam", L"InstallPath") > 0) {
path = buf;
path.AppendPath("steamapps\\common\\doom 3");
if (_stat(path.c_str(), &st) != -1 && st.st_mode & _S_IFDIR)
return true;
}
common->Warning("vanilla doom3 path not found"); common->Warning("vanilla doom3 path not found");
return false; return false;