From 66633ead443819df5aacc87b3fd1fdee85cddfde Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Mon, 16 Mar 2026 16:02:36 -0500 Subject: 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 --- libs/basic_games_native/src/basicgameplugin.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'libs/basic_games_native/src') 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 -- cgit v1.3.1