From c2261d51033088429ba960879dd4d9731e6f9bc1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Mar 2015 17:06:51 +0100 Subject: + Support for MPQ.KangTooJee map protector + Compacting optimized --- src/SFileListFile.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/SFileListFile.cpp') diff --git a/src/SFileListFile.cpp b/src/SFileListFile.cpp index f4069c0..ab6dff2 100644 --- a/src/SFileListFile.cpp +++ b/src/SFileListFile.cpp @@ -354,6 +354,8 @@ static int SListFileCreateNodeForAllLocales(TMPQArchive * ha, const char * szFil // Now find the next language version of the file pHash = GetNextHashEntry(ha, pFirstHash, pHash); } + + return ERROR_SUCCESS; } return ERROR_CAN_NOT_COMPLETE; @@ -372,7 +374,7 @@ int SListFileSaveToMpq(TMPQArchive * ha) { // At this point, we expect to have at least one reserved entry in the file table assert(ha->dwFlags & MPQ_FLAG_LISTFILE_INVALID); - assert(ha->dwReservedFiles >= 1); + assert(ha->dwReservedFiles > 0); // Create the raw data that is to be written to (listfile) // Note: Creating the raw data before the (listfile) has been created in the MPQ @@ -409,16 +411,13 @@ int SListFileSaveToMpq(TMPQArchive * ha) } else { - // If the list file is empty, we assume ERROR_SUCCESS + // If the (listfile) file would be empty, its OK nError = (cbListFile == 0) ? ERROR_SUCCESS : ERROR_NOT_ENOUGH_MEMORY; } - // If the save process succeeded, we clear the MPQ_FLAG_LISTFILE_INVALID flag - if(nError == ERROR_SUCCESS) - { - ha->dwFlags &= ~MPQ_FLAG_LISTFILE_INVALID; - ha->dwReservedFiles--; - } + // Clear the listfile flags + ha->dwFlags &= ~MPQ_FLAG_LISTFILE_INVALID; + ha->dwReservedFiles--; } return nError; -- cgit v1.2.3