From f382c3fb5ba9971300d4aa8cdbd594c5507217fb Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Fri, 7 Nov 2025 10:30:46 -0500 Subject: [PATCH] Fix gamedata gamebin paths for x64, CS:GO-based games (#2370) (#2374) --- bridge/include/IFileSystemBridge.h | 1 + core/logic/GameConfigs.cpp | 17 +++++++++++------ core/logic_bridge.cpp | 20 ++++++++++++++++++++ 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/bridge/include/IFileSystemBridge.h b/bridge/include/IFileSystemBridge.h index 4c62506f7..1ea90e55b 100644 --- a/bridge/include/IFileSystemBridge.h +++ b/bridge/include/IFileSystemBridge.h @@ -58,6 +58,7 @@ public: virtual bool IsDirectory(const char *pFileName, const char *pathID = 0) = 0; virtual void CreateDirHierarchy(const char *path, const char *pathID = 0) = 0; virtual int GetSearchPath(const char* pathID, bool bGetPackFiles, char* pPath, int nMaxLen) = 0; + virtual const char * GetGameBinArchSubdirectory() = 0; }; } // namespace SourceMod diff --git a/core/logic/GameConfigs.cpp b/core/logic/GameConfigs.cpp index 64018008d..b141335c1 100644 --- a/core/logic/GameConfigs.cpp +++ b/core/logic/GameConfigs.cpp @@ -1094,13 +1094,18 @@ void GameBinPathManager::Init() std::istringstream iss(search_path); for (std::string path; std::getline(iss, path, ';');) { - if (path.length() > 0 - && path.find(addons_folder) == std::string::npos - && m_lookup.find(path) == m_lookup.cend() - ) + if (path.length() > 0) { - m_lookup.insert(path); - m_ordered.push_back(path); + const char* arch_subdir = bridge->filesystem->GetGameBinArchSubdirectory(); + std::string full_path = path + arch_subdir; + if (full_path.find(addons_folder) == std::string::npos + && m_lookup.find(full_path) == m_lookup.cend() + ) + { + m_lookup.insert(full_path); + m_ordered.push_back(full_path); + + } } } diff --git a/core/logic_bridge.cpp b/core/logic_bridge.cpp index 4e0e8d88a..222cd797d 100644 --- a/core/logic_bridge.cpp +++ b/core/logic_bridge.cpp @@ -194,6 +194,26 @@ public: { return filesystem->GetSearchPath(pathID, bGetPackFiles, pPath, nMaxLen); } + const char* GetGameBinArchSubdirectory() override + { +#if defined KE_ARCH_X64 +#if SOURCE_ENGINE >= SE_BLADE +#ifdef PLATFORM_WINDOWS +#if SOURCE_ENGINE == SE_MCV + return "win64" PLATFORM_SEP; +#else + return "x64" PLATFORM_SEP; +#endif // SOURCE_ENGINE == SE_MCV +#else + return "linux64" PLATFORM_SEP; +#endif // PLATFORM_WINDOWS +#else + // Already included in the GameBin path(s), if required + return ""; +#endif // SOURCE_ENGINE >= SE_BLADE +#endif // KE_ARCH_X64 + return "win32" PLATFORM_SEP; + } } fs_wrapper; class VPlayerInfo_Logic : public IPlayerInfoBridge