From 999ee276cfd7420abaf7566932b591677aff184f Mon Sep 17 00:00:00 2001 From: Ladislav Zezula Date: Thu, 2 Feb 2023 00:22:24 +0100 Subject: Fixed bugs --- src/SFileFindFile.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/SFileFindFile.cpp') diff --git a/src/SFileFindFile.cpp b/src/SFileFindFile.cpp index 4de1022..b741e5f 100644 --- a/src/SFileFindFile.cpp +++ b/src/SFileFindFile.cpp @@ -213,7 +213,7 @@ static bool DoMPQSearch_FileEntry( TFileEntry * pPatchEntry; HANDLE hFile = NULL; const char * szFileName; - size_t nPrefixLength = (ha->pPatchPrefix != NULL) ? ha->pPatchPrefix->nLength : 0; + size_t nGlobalPrefixLength = (ha->pPatchPrefix != NULL) ? ha->pPatchPrefix->nLength : 0; DWORD dwBlockIndex; char szNameBuff[MAX_PATH]; @@ -227,6 +227,8 @@ static bool DoMPQSearch_FileEntry( // Now we have to check if this file was not enumerated before if(!FileWasFoundBefore(ha, hs, pFileEntry)) { + size_t nPrefixLength = nGlobalPrefixLength; + // if(pFileEntry != NULL && !_stricmp(pFileEntry->szFileName, "TriggerLibs\\NativeLib.galaxy")) // DebugBreak(); @@ -246,8 +248,9 @@ static bool DoMPQSearch_FileEntry( if(SFileOpenFileEx((HANDLE)hs->ha, szNameBuff, SFILE_OPEN_BASE_FILE, &hFile)) { SFileGetFileName(hFile, szNameBuff); - szFileName = szNameBuff; SFileCloseFile(hFile); + szFileName = szNameBuff; + nPrefixLength = 0; } } -- cgit v1.2.3