Skip to content

Commit

Permalink
Next round
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelIT7 committed Jul 17, 2024
1 parent accf4b0 commit 04ba6ef
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions source/modules/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,16 +585,21 @@ const char* hook_CBaseFileSystem_FindFirstEx(CBaseFileSystem* filesystem, const
Detouring::Hook detour_CBaseFileSystem_FindNext;
const char* hook_CBaseFileSystem_FindNext(CBaseFileSystem* filesystem, FileFindHandle_t pHandle)
{
Msg("Find Count: %i\n", filesystem->m_FindData.Count());
CBaseFileSystem::FindData_t* data = &filesystem->m_FindData[pHandle];
Msg("Data: %p\n", data);
AddFileToSearchCache(data->findData.cFileName, data->m_CurrentStoreID);
CBaseFileSystem::FindData_t* data;
if ( pHandle > 0 )
{
Msg("Find Count: %i\n", filesystem->m_FindData.Count());
data = &filesystem->m_FindData[pHandle];
Msg("Data: %p\n", data);
AddFileToSearchCache(data->findData.cFileName, data->m_CurrentStoreID);
}

const char* ret = detour_CBaseFileSystem_FindNext.GetTrampoline<Symbols::CBaseFileSystem_FindNext>()(filesystem, pHandle);
if (!ret || !holylib_filesystem_searchcache.GetBool())
return ret;

AddFileToSearchCache(ret, data->m_CurrentStoreID);
if ( pHandle > 0 )
AddFileToSearchCache(ret, data->m_CurrentStoreID);
}

void CFileSystemModule::Init(CreateInterfaceFn* appfn, CreateInterfaceFn* gamefn)
Expand Down

0 comments on commit 04ba6ef

Please sign in to comment.