diff options
| author | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-03-16 16:02:36 -0500 |
|---|---|---|
| committer | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-03-16 16:02:36 -0500 |
| commit | 66633ead443819df5aacc87b3fd1fdee85cddfde (patch) | |
| tree | 02ae6b7b82d090e3d6953fb1278c269725c65a30 /libs | |
| parent | d7f4ef89b50861696a6fc2d74d29aabbed8c391b (diff) | |
Fix looksValid() for games with nested data directories (e.g. Oblivion Remastered)
Some UE5 games have their binary nested under a subdirectory of the Steam
installdir even though the appmanifest points one level up. looksValid()
was checking only for the binary at the game root, causing "does not seem
to contain a game Mod Organizer can manage" when manually browsing.
Add a fallback: if the binary isn't found at root, resolve the game's
%GAME_PATH%-based dataDirectory and check if that path exists. The data
path is unique enough to positively identify the game directory.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/basic_games_native/src/basicgameplugin.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/libs/basic_games_native/src/basicgameplugin.cpp b/libs/basic_games_native/src/basicgameplugin.cpp index 042f899..0631210 100644 --- a/libs/basic_games_native/src/basicgameplugin.cpp +++ b/libs/basic_games_native/src/basicgameplugin.cpp @@ -315,7 +315,26 @@ int BasicGamePlugin::nexusGameID() const bool BasicGamePlugin::looksValid(QDir const& dir) const { - return dir.exists(m_def.binaryName); + // Primary check: binary at game root + if (dir.exists(m_def.binaryName)) + return true; + + // Fallback: check if the data directory exists relative to this path. + // Some UE5 games (e.g. Oblivion Remastered) have their root exe nested + // under a subdirectory even though the appmanifest installdir points one + // level up. If the unique data path resolves, it's the right directory. + if (!m_def.dataDirectory.isEmpty()) { + QString dataDir = m_def.dataDirectory; + dataDir.replace('\\', '/'); + // Only handle %GAME_PATH% here; other vars need context we don't have + if (!dataDir.contains('%') || dataDir.startsWith("%GAME_PATH%")) { + dataDir.replace("%GAME_PATH%", dir.absolutePath()); + if (!dataDir.contains('%') && QDir(dataDir).exists()) + return true; + } + } + + return false; } QString BasicGamePlugin::gameVersion() const |
