aboutsummaryrefslogtreecommitdiff
path: root/libs/game_bethesda
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-04-03 10:50:22 -0500
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-04-03 10:50:22 -0500
commitd226c68de9a858a372c5e9a6e83d72dac676559f (patch)
tree947daff1835b5ef8946ecfc34cd598dd76c04ef2 /libs/game_bethesda
parent1ce8f010b6e99bd425f6fa74b87936ee3f8f3339 (diff)
Fix cabextract not found in pressure-vessel and TTW game detection
cabextract: The system binary under /usr is invisible inside the pressure-vessel container where winetricks runs. Always download a local copy to ~/.local/share/fluorine/bin/ instead of short-circuiting when the host has it installed. TTW: The game plugin was calling the base class identifyGamePath() which tried matching "TTW" against NaK's detected game names — never matching "Fallout New Vegas". Now explicitly searches for FNV in the NaK results, mirroring how the Windows path uses the FalloutNV registry key. Also adds HAS_NAK_FFI and nak_ffi linkage to the TTW CMake target since it was previously only defined for the game_gamebryo target. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'libs/game_bethesda')
-rw-r--r--libs/game_bethesda/src/games/ttw/CMakeLists.txt7
-rw-r--r--libs/game_bethesda/src/games/ttw/gamefalloutttw.cpp27
2 files changed, 32 insertions, 2 deletions
diff --git a/libs/game_bethesda/src/games/ttw/CMakeLists.txt b/libs/game_bethesda/src/games/ttw/CMakeLists.txt
index 27149ec..828b67f 100644
--- a/libs/game_bethesda/src/games/ttw/CMakeLists.txt
+++ b/libs/game_bethesda/src/games/ttw/CMakeLists.txt
@@ -17,4 +17,11 @@ add_library(game_ttw SHARED
mo2_configure_plugin(game_ttw NO_SOURCES WARNINGS 4)
mo2_default_source_group()
target_link_libraries(game_ttw PRIVATE game_gamebryo)
+
+# NaK FFI for TTW game detection (TTW uses FalloutNV as base game)
+if(TARGET mo2::nak_ffi)
+ target_link_libraries(game_ttw PRIVATE mo2::nak_ffi)
+ target_compile_definitions(game_ttw PRIVATE HAS_NAK_FFI)
+endif()
+
mo2_install_plugin(game_ttw)
diff --git a/libs/game_bethesda/src/games/ttw/gamefalloutttw.cpp b/libs/game_bethesda/src/games/ttw/gamefalloutttw.cpp
index 3ffa5a1..cfd8ca8 100644
--- a/libs/game_bethesda/src/games/ttw/gamefalloutttw.cpp
+++ b/libs/game_bethesda/src/games/ttw/gamefalloutttw.cpp
@@ -15,6 +15,11 @@
#include <gamebryosavegameinfo.h>
#include <gamebryounmanagedmods.h>
+#ifdef HAS_NAK_FFI
+#include <nak_ffi.h>
+#include "scopeguard.h"
+#endif
+
#include <QCoreApplication>
#include <QDir>
#include <QFileInfo>
@@ -80,8 +85,26 @@ QString GameFalloutTTW::identifyGamePath() const
QString path = "Software\\Bethesda Softworks\\FalloutNV";
result = findInRegistry(HKEY_LOCAL_MACHINE, path.toStdWString().c_str(),
L"Installed Path");
-#else
- result = GameGamebryo::identifyGamePath();
+#elif defined(HAS_NAK_FFI)
+ // TTW uses FalloutNV as its base game, so look for Fallout New Vegas
+ // (the base class would try matching "TTW" which NaK doesn't know about)
+ NakGameList gameList = nak_detect_all_games();
+ ON_BLOCK_EXIT([&]() {
+ nak_game_list_free(gameList);
+ });
+
+ for (size_t i = 0; i < gameList.count; ++i) {
+ const NakGame& game = gameList.games[i];
+ QString detectedName = QString::fromUtf8(game.name);
+ if (detectedName.contains("Fallout", Qt::CaseInsensitive) &&
+ detectedName.contains("Vegas", Qt::CaseInsensitive)) {
+ QString detectedPath = QString::fromUtf8(game.install_path);
+ if (looksValid(QDir(detectedPath))) {
+ result = detectedPath;
+ break;
+ }
+ }
+ }
#endif
// EPIC Game Store
if (result.isEmpty()) {