mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-10-08 21:11:39 +00:00
Fix broad search issue with old UE games at FindFilePath
This commit is contained in:
1 parent
d817d5b4c8
commit
bd6407daec
1 file changed
+24
-1
+24
-1
@@ -562,7 +562,30 @@ std::optional<std::filesystem::path> Util::FindFilePath(const std::filesystem::p
|
||||
// Move up two more levels from 'parent' to reach UE project root but one level for KCD2
|
||||
std::filesystem::path gameRoot;
|
||||
if (cnt < 2)
|
||||
gameRoot = parent.parent_path().parent_path();
|
||||
{
|
||||
do
|
||||
{
|
||||
// Check one below Win64, old UE games have binaries here
|
||||
gameRoot = parent.parent_path();
|
||||
|
||||
if (std::filesystem::exists(gameRoot / "Binaries") &&
|
||||
std::filesystem::is_directory(gameRoot / "Binaries"))
|
||||
{
|
||||
gameRoot = gameRoot.parent_path();
|
||||
break;
|
||||
}
|
||||
|
||||
// Check two below Win64, newer UE games have binaries here
|
||||
gameRoot = gameRoot.parent_path();
|
||||
|
||||
if (std::filesystem::exists(gameRoot / "Binaries") &&
|
||||
std::filesystem::is_directory(gameRoot / "Binaries"))
|
||||
{
|
||||
gameRoot = gameRoot.parent_path();
|
||||
break;
|
||||
}
|
||||
} while (false);
|
||||
}
|
||||
else
|
||||
gameRoot = parent.parent_path();
|
||||
|
||||
|
||||
Reference in new issue
Block a user