From f2a388780f83cfd95afa27b01dafe3a683b0e39c Mon Sep 17 00:00:00 2001 From: Ladislav Zezula Date: Fri, 6 Dec 2013 15:20:47 +0100 Subject: + Bug fixes in SFileGetFileInfo, SAttrFileSaveToMpq, SListFileSaveToMpq + FileStream now handles files over 2GB properly + Test under Linux --- src/SFileListFile.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/SFileListFile.cpp') diff --git a/src/SFileListFile.cpp b/src/SFileListFile.cpp index f98c92b..896b341 100644 --- a/src/SFileListFile.cpp +++ b/src/SFileListFile.cpp @@ -382,19 +382,13 @@ int SListFileSaveToMpq(TMPQArchive * ha) // At this point, we expect to have at least one reserved entry in the file table assert(ha->dwReservedFiles >= 1); + ha->dwReservedFiles--; // 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 // causes that the name of the listfile will not be included in the listfile itself. // That is OK, because (listfile) in Blizzard MPQs does not contain it either. pbListFile = CreateListFile(ha, &cbListFile); - - // Now we decrement the number of reserved files. - // This frees one slot in the file table, so the subsequent file create operation should succeed - // This must happen even if the listfile cannot be created - ha->dwReservedFiles--; - - // If the listfile create succeeded, we write it to the MPQ if(pbListFile != NULL) { // We expect it to be nonzero size -- cgit v1.2.3