From 870acd582701bc67c29b48319972303e5ceb706d Mon Sep 17 00:00:00 2001 From: Ladislav Date: Mon, 18 Nov 2013 12:35:21 +0100 Subject: + Adding files to MPQ no longer removes (listfile) and (attributes) when not enough space in the hash table + Fixes in deletion of files from MPQs v 4.0 --- src/SFileCreateArchive.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/SFileCreateArchive.cpp') diff --git a/src/SFileCreateArchive.cpp b/src/SFileCreateArchive.cpp index 39332a6..78ddd71 100644 --- a/src/SFileCreateArchive.cpp +++ b/src/SFileCreateArchive.cpp @@ -211,13 +211,13 @@ bool WINAPI SFileCreateArchive2(const TCHAR * szMpqName, PSFILE_CREATE_MPQ pCrea nError = WriteNakedMPQHeader(ha); // Remember that the (listfile) and (attributes) need to be saved - ha->dwFlags |= MPQ_FLAG_CHANGED | MPQ_FLAG_INV_LISTFILE | MPQ_FLAG_INV_ATTRIBUTES; + ha->dwFlags |= MPQ_FLAG_CHANGED | MPQ_FLAG_LISTFILE_INVALID | MPQ_FLAG_ATTRIBUTES_INVALID; } // Create initial HET table, if the caller required an MPQ format 3.0 or newer if(nError == ERROR_SUCCESS && pCreateInfo->dwMpqVersion >= MPQ_FORMAT_VERSION_3) { - ha->pHetTable = CreateHetTable(ha->dwMaxFileCount, 0x40, true); + ha->pHetTable = CreateHetTable(0, ha->dwFileTableSize, 0x40, true); if(ha->pHetTable == NULL) nError = ERROR_NOT_ENOUGH_MEMORY; } -- cgit v1.2.3