Skip to content

Commit eec7547

Browse files
author
Ladislav Zezula
committed
+ SFILE_FIND_DATA now contains base hash index, instead of patch hash index
1 parent 2d3b3e1 commit eec7547

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/SFileFindFile.cpp

+6-3
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ static int DoMPQSearch(TMPQSearch * hs, SFILE_FIND_DATA * lpFindFileData)
288288
// Now we have to check if this file was not enumerated before
289289
if(!FileWasFoundBefore(ha, hs, pFileEntry))
290290
{
291+
// if(pFileEntry != NULL && !_stricmp(pFileEntry->szFileName, "TriggerLibs\\NativeLib.galaxy"))
292+
// DebugBreak();
293+
291294
// Find a patch to this file
292295
pPatchEntry = FindPatchEntry(ha, pFileEntry);
293296
if(pPatchEntry == NULL)
@@ -310,14 +313,14 @@ static int DoMPQSearch(TMPQSearch * hs, SFILE_FIND_DATA * lpFindFileData)
310313
}
311314
}
312315

313-
// If the file name is still NULL, we cannot include the file to the search
316+
// If the file name is still NULL, we cannot include the file to search results
314317
if(szFileName != NULL)
315318
{
316319
// Check the file name against the wildcard
317320
if(CheckWildCard(szFileName + nPrefixLength, hs->szSearchMask))
318321
{
319-
// Fill the found entry
320-
lpFindFileData->dwHashIndex = pPatchEntry->dwHashIndex;
322+
// Fill the found entry. hash entry and block index are taken from the base MPQ
323+
lpFindFileData->dwHashIndex = pFileEntry->dwHashIndex;
321324
lpFindFileData->dwBlockIndex = dwBlockIndex;
322325
lpFindFileData->dwFileSize = pPatchEntry->dwFileSize;
323326
lpFindFileData->dwFileFlags = pPatchEntry->dwFlags;

test/StormTest.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -1582,6 +1582,8 @@ static int SearchArchive(
15821582
dwFileCount++;
15831583

15841584
// if(!_stricmp(sf.cFileName, "DBFilesClient\\Item-Sparse.db2"))
1585+
// DebugBreak();
1586+
// if(!_stricmp(sf.cFileName, "TriggerLibs\\NativeLib.galaxy"))
15851587
// DebugBreak();
15861588

15871589
if(dwTestFlags & TEST_FLAG_MOST_PATCHED)
@@ -3837,7 +3839,7 @@ int main(int argc, char * argv[])
38373839
// Search all testing archives and verify their SHA1 hash
38383840
// if(nError == ERROR_SUCCESS)
38393841
// nError = FindFiles(ForEachFile_VerifyFileChecksum, szMpqSubDir);
3840-
3842+
/*
38413843
// Test reading linear file without bitmap
38423844
if(nError == ERROR_SUCCESS)
38433845
nError = TestFileStreamOperations("MPQ_2013_v4_alternate-original.MPQ", 0);
@@ -4003,7 +4005,7 @@ int main(int argc, char * argv[])
40034005
// Open a patched archive.
40044006
if(nError == ERROR_SUCCESS)
40054007
nError = TestOpenArchive_Patched(PatchList_WoW_16965, "DBFilesClient\\BattlePetNPCTeamMember.db2", 0);
4006-
4008+
*/
40074009
// Open a patched archive.
40084010
if(nError == ERROR_SUCCESS)
40094011
nError = TestOpenArchive_Patched(PatchList_SC2_32283, "TriggerLibs\\natives.galaxy", 6);

0 commit comments

Comments
 (0)