Also load files from main directory

Still compatible with previous commit
This commit is contained in:
Amos
2022-01-27 04:12:41 +01:00
parent 3eec52e79b
commit ac566d73aa

View File

@@ -61,11 +61,19 @@ FileHandle_t HCBaseFileSystem_ReadFromVPK(void* pVpk, std::int64_t* pResults, ch
{ {
// Erase '//*/'. // Erase '//*/'.
svFilePath.erase(0, 4); svFilePath.erase(0, 4);
// Check if file exist in the main game folder.
if (FileExists(svFilePath.c_str()))
{
*pResults = -1;
return (void*)pResults;
}
} }
// TODO: obtain 'mod' SearchPath's instead. // TODO: obtain 'mod' SearchPath's instead.
svFilePath.insert(0, "platform\\"); svFilePath.insert(0, "platform\\");
// Check if file exist in 'mod' folders.
if (FileExists(svFilePath.c_str()) /*|| FileExists(pszFilePath)*/) if (FileExists(svFilePath.c_str()) /*|| FileExists(pszFilePath)*/)
{ {
*pResults = -1; *pResults = -1;
@@ -85,12 +93,19 @@ bool HCBaseFileSystem_ReadFromCache(void* pFileSystem, char* pszFilePath, void*
{ {
// Erase '//*/'. // Erase '//*/'.
svFilePath.erase(0, 4); svFilePath.erase(0, 4);
// Check if file exist in the main game folder.
if (FileExists(svFilePath.c_str()))
{
return false;
}
} }
// TODO: obtain 'mod' SearchPath's instead. // TODO: obtain 'mod' SearchPath's instead.
svFilePath.insert(0, "platform\\"); svFilePath.insert(0, "platform\\");
if (FileExists(svFilePath.c_str()) /*|| FileExists(pszFilePath)*/) // Check if file exist in 'mod' folders.
if (FileExists(svFilePath.c_str()))
{ {
return false; return false;
} }