mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-06 18:08:36 +00:00
Fix gamedata gamebin paths for x64, CS:GO-based games (#2370)
This commit is contained in:
parent
66d3f5e60e
commit
025fcc5ab0
@ -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
|
||||
|
||||
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user