From d13270a686a9ce21614f103bc134615be75c263a Mon Sep 17 00:00:00 2001 From: Ladislav Zezula Date: Sun, 11 Feb 2024 09:46:30 +0100 Subject: The flag MPQ_OPEN_NO_LISTFILE is now propagated by SFileOpenPatchArchive --- src/SFilePatchArchives.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/SFilePatchArchives.cpp') diff --git a/src/SFilePatchArchives.cpp b/src/SFilePatchArchives.cpp index e5fe32b..5d9450d 100644 --- a/src/SFilePatchArchives.cpp +++ b/src/SFilePatchArchives.cpp @@ -1081,7 +1081,6 @@ void Patch_Finalize(TMPQPatcher * pPatcher) } } - //----------------------------------------------------------------------------- // Public functions @@ -1096,9 +1095,6 @@ bool WINAPI SFileOpenPatchArchive( HANDLE hPatchMpq = NULL; DWORD dwErrCode = ERROR_SUCCESS; - // Keep compiler happy - dwFlags = dwFlags; - // Verify input parameters if(!IsValidMpqHandle(hMpq)) dwErrCode = ERROR_INVALID_HANDLE; @@ -1114,7 +1110,7 @@ bool WINAPI SFileOpenPatchArchive( // 2) Modify or replace a file // 3) Add patch archive to the opened MPQ // 4) Read patched file - // 5) Now what ? + // 5) Now what? // if(dwErrCode == ERROR_SUCCESS) @@ -1126,7 +1122,11 @@ bool WINAPI SFileOpenPatchArchive( // Open the archive like it is normal archive if(dwErrCode == ERROR_SUCCESS) { - if(SFileOpenArchive(szPatchMpqName, 0, MPQ_OPEN_READ_ONLY | MPQ_OPEN_PATCH, &hPatchMpq)) + // These flags will be propagated to SFileOpenArchive + dwFlags = (dwFlags & MPQ_OPEN_NO_LISTFILE) | MPQ_OPEN_READ_ONLY | MPQ_OPEN_PATCH; + + // Open the patch as MPQ + if(SFileOpenArchive(szPatchMpqName, 0, dwFlags, &hPatchMpq)) { // Cast the archive handle to structure pointer haPatch = (TMPQArchive *)hPatchMpq; -- cgit v1.2.3