diff options
| author | unknown <E:\Ladik\Mail> | 2015-05-04 07:26:51 +0200 | 
|---|---|---|
| committer | unknown <E:\Ladik\Mail> | 2015-05-04 07:26:51 +0200 | 
| commit | d39d99944be052456d3c69482fe59ee7ed43b77b (patch) | |
| tree | 9f0161f02c8618fb3b6f24834218a9127daa716f | |
| parent | 250891b7c53359dec2c2c6072501c609c2dde217 (diff) | |
+ The "(attributes)" file si only loaded if the block table was not cut
| -rw-r--r-- | src/SFileAttributes.cpp | 1 | ||||
| -rw-r--r-- | src/SFileOpenArchive.cpp | 2 | ||||
| -rw-r--r-- | test/StormTest.cpp | 8 | 
3 files changed, 6 insertions, 5 deletions
diff --git a/src/SFileAttributes.cpp b/src/SFileAttributes.cpp index dacfd3b..bd1956d 100644 --- a/src/SFileAttributes.cpp +++ b/src/SFileAttributes.cpp @@ -367,6 +367,7 @@ int SAttrLoadAttributes(TMPQArchive * ha)      // File table must be initialized      assert(ha->pFileTable != NULL); +    assert((ha->dwFlags & MPQ_FLAG_BLOCK_TABLE_CUT) == 0);      // Don't load the attributes file from malformed Warcraft III maps      if(ha->dwFlags & MPQ_FLAG_MALFORMED) diff --git a/src/SFileOpenArchive.cpp b/src/SFileOpenArchive.cpp index 5ce4290..35fd4dd 100644 --- a/src/SFileOpenArchive.cpp +++ b/src/SFileOpenArchive.cpp @@ -410,7 +410,7 @@ bool WINAPI SFileOpenArchive(      }      // Load the "(attributes)" file and merge it to the file table -    if(nError == ERROR_SUCCESS && (dwFlags & MPQ_OPEN_NO_ATTRIBUTES) == 0) +    if(nError == ERROR_SUCCESS && (dwFlags & MPQ_OPEN_NO_ATTRIBUTES) == 0 && (ha->dwFlags & MPQ_FLAG_BLOCK_TABLE_CUT) == 0)      {          // Quick check for (attributes)          pFileEntry = GetFileEntryLocale(ha, ATTRIBUTES_NAME, LANG_NEUTRAL); diff --git a/test/StormTest.cpp b/test/StormTest.cpp index 3af6c0b..b4e9702 100644 --- a/test/StormTest.cpp +++ b/test/StormTest.cpp @@ -4087,11 +4087,11 @@ int main(int argc, char * argv[])      // Open an Warcraft III map locked by the BOBA protector      if(nError == ERROR_SUCCESS)          nError = TestOpenArchive("MPQ_2002_v1_ProtectedMap_BOBA.w3m"); - +*/      // Open an Warcraft III map locked by a protector      if(nError == ERROR_SUCCESS)          nError = TestOpenArchive("MPQ_2015_v1_ProtectedMap_KangTooJee.w3x"); - +/*      // Open an Warcraft III map locked by a protector      if(nError == ERROR_SUCCESS)          nError = TestOpenArchive("MPQ_2015_v1_ProtectedMap_Somj2hM16.w3x"); @@ -4163,7 +4163,7 @@ int main(int argc, char * argv[])      // Open a patched archive      if(nError == ERROR_SUCCESS)          nError = TestOpenArchive_Patched(PatchList_SC2_34644, "TriggerLibs\\GameData\\GameData.galaxy", 2); -*/ +      // Open a patched archive with new format of BSDIFF patch      if(nError == ERROR_SUCCESS)          nError = TestOpenArchive_Patched(PatchList_SC2_34644_Maps, "Maps\\Campaign\\THorner03.SC2Map\\BankList.xml", 3); @@ -4312,7 +4312,7 @@ int main(int argc, char * argv[])      // Test replacing a file with zero size file      if(nError == ERROR_SUCCESS)          nError = TestModifyArchive_ReplaceFile("MPQ_2014_v4_Base.StormReplay", "AddFile-replay.message.events"); - +*/  #ifdef _MSC_VER      _CrtDumpMemoryLeaks();  #endif  // _MSC_VER  | 
