diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-11-05 20:52:53 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-12-08 18:16:46 +0100 |
commit | 6b6d5aff0530d43875572edc9616bc788ed8a26c (patch) | |
tree | 8d0ad02913e4b625b2b2c26d3daff9b8a354360c /dep/CascLib/src/CascIndexFiles.cpp | |
parent | 5095bcbf1cf57dae0e58e1d1251b566952352047 (diff) |
Dep/CascLib: Update to ladislav-zezula/CascLib@737a8705b5b8f7ce3917f5d5ff9767b18de1285e
Diffstat (limited to 'dep/CascLib/src/CascIndexFiles.cpp')
-rw-r--r-- | dep/CascLib/src/CascIndexFiles.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/dep/CascLib/src/CascIndexFiles.cpp b/dep/CascLib/src/CascIndexFiles.cpp index bfcee15330b..bc50f9f25bb 100644 --- a/dep/CascLib/src/CascIndexFiles.cpp +++ b/dep/CascLib/src/CascIndexFiles.cpp @@ -50,8 +50,8 @@ static bool IndexDirectory_OnFileFound( { TCascStorage * hs = (TCascStorage *)pvContext; PCASC_INDEX pIndexFile; - DWORD IndexValue = 0; DWORD IndexVersion = 0; + DWORD IndexValue = 0; // Auto-detect the format of the index file name if(hs->szIndexFormat == NULL) @@ -71,9 +71,9 @@ static bool IndexDirectory_OnFileFound( return false; // Get the main index from the first two digits - if(ConvertStringToInt32(szFileName, 2, &IndexValue) != ERROR_SUCCESS) + if(ConvertStringToInt(szFileName + 0, 2, IndexValue) != ERROR_SUCCESS) return false; - if(ConvertStringToInt32(szFileName + 2, 8, &IndexVersion) != ERROR_SUCCESS) + if(ConvertStringToInt(szFileName + 2, 8, IndexVersion) != ERROR_SUCCESS) return false; } else if(hs->szIndexFormat == szIndexFormat_V1) @@ -83,9 +83,9 @@ static bool IndexDirectory_OnFileFound( return false; // Get the main index from the first two digits - if(ConvertDigitToInt32(szFileName + 6, &IndexValue) != ERROR_SUCCESS) + if(ConvertStringToInt(szFileName + 6, 1, IndexValue) != ERROR_SUCCESS) return false; - if(ConvertDigitToInt32(szFileName + 7, &IndexVersion) != ERROR_SUCCESS) + if(ConvertStringToInt(szFileName + 7, 1, IndexVersion) != ERROR_SUCCESS) return false; } else @@ -316,10 +316,8 @@ static DWORD LoadIndexItems(TCascStorage * hs, CASC_INDEX_HEADER & InHeader, EKE while((pbEKeyEntry + EntryLength) <= pbEKeyEnd) { - // ENCODING, DOWNLOAD, ROOT in Warcraft III Reforged build 14481 - BREAK_ON_XKEY3(pbEKeyEntry, 0xcd, 0x3b, 0xd8); - BREAK_ON_XKEY3(pbEKeyEntry, 0xdb, 0xfa, 0x35); - BREAK_ON_XKEY3(pbEKeyEntry, 0x5c, 0xe8, 0x48); + // ENCODING for Starcraft II Beta + BREAK_ON_XKEY3(pbEKeyEntry, 0x8b, 0x0d, 0x9a); if(!PfnEKeyEntry(hs, InHeader, pbEKeyEntry)) return ERROR_INDEX_PARSING_DONE; @@ -581,7 +579,7 @@ static DWORD LoadLocalIndexFiles(TCascStorage * hs) if((IndexFile.pbFileData = LoadFileToMemory(IndexFile.szFileName, &cbFileData)) == NULL) { // Storages downloaded by Blizzget tool don't have all index files present - if((dwErrCode = GetLastError()) == ERROR_FILE_NOT_FOUND) + if((dwErrCode = GetCascError()) == ERROR_FILE_NOT_FOUND) { dwErrCode = ERROR_SUCCESS; break; |