Fix gamedata gamebin paths for x64, CS:GO-based games (#2370) (#2374)
Some checks are pending
Continuous Integration / ${{ matrix.os_short }}-${{ matrix.compiler_cc }} (clang, clang++, ubuntu-latest, linux) (push) Waiting to run
Continuous Integration / ${{ matrix.os_short }}-${{ matrix.compiler_cc }} (clang-14, clang++-14, ubuntu-22.04, linux) (push) Waiting to run
Continuous Integration / ${{ matrix.os_short }}-${{ matrix.compiler_cc }} (msvc, windows-latest, win) (push) Waiting to run
hl2sdk-mock tests / mock (push) Waiting to run

This commit is contained in:
Nicholas Hastings 2025-11-07 10:30:46 -05:00 committed by GitHub
parent 4374cb2168
commit f382c3fb5b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 32 additions and 6 deletions

View File

@ -58,6 +58,7 @@ public:
virtual bool IsDirectory(const char *pFileName, const char *pathID = 0) = 0; virtual bool IsDirectory(const char *pFileName, const char *pathID = 0) = 0;
virtual void CreateDirHierarchy(const char *path, 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 int GetSearchPath(const char* pathID, bool bGetPackFiles, char* pPath, int nMaxLen) = 0;
virtual const char * GetGameBinArchSubdirectory() = 0;
}; };
} // namespace SourceMod } // namespace SourceMod

View File

@ -1094,13 +1094,18 @@ void GameBinPathManager::Init()
std::istringstream iss(search_path); std::istringstream iss(search_path);
for (std::string path; std::getline(iss, path, ';');) for (std::string path; std::getline(iss, path, ';');)
{ {
if (path.length() > 0 if (path.length() > 0)
&& path.find(addons_folder) == std::string::npos
&& m_lookup.find(path) == m_lookup.cend()
)
{ {
m_lookup.insert(path); const char* arch_subdir = bridge->filesystem->GetGameBinArchSubdirectory();
m_ordered.push_back(path); 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);
}
} }
} }

View File

@ -194,6 +194,26 @@ public:
{ {
return filesystem->GetSearchPath(pathID, bGetPackFiles, pPath, nMaxLen); 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; } fs_wrapper;
class VPlayerInfo_Logic : public IPlayerInfoBridge class VPlayerInfo_Logic : public IPlayerInfoBridge