diff options
author | Shauren <shauren.trinity@gmail.com> | 2023-09-05 00:10:35 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2023-09-05 00:10:35 +0200 |
commit | d57b58849bda868f2463d38cc636f01af919316c (patch) | |
tree | 5beef62c041526d9468683e4388b6341f1530cc1 /dep/CascLib/src/CascFiles.cpp | |
parent | ba224f70ad81fa0e5d1f0c4daf197e143317cdaa (diff) |
Dep/CascLib: Update to ladislav-zezula/CascLib@5c60050770767f2e606f6fec0c35beb8b9b00c60
Diffstat (limited to 'dep/CascLib/src/CascFiles.cpp')
-rw-r--r-- | dep/CascLib/src/CascFiles.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/dep/CascLib/src/CascFiles.cpp b/dep/CascLib/src/CascFiles.cpp index 90544cb2031..58d239e60ad 100644 --- a/dep/CascLib/src/CascFiles.cpp +++ b/dep/CascLib/src/CascFiles.cpp @@ -523,7 +523,7 @@ static DWORD LoadBuildNumber(TCascStorage * hs, const char * /* szVariableName * // "build-name = 1.21.5.4037-retail" while(szDataBegin < szDataEnd) { - // There must be at least three digits (build 99 anyone?) + // If the character is a digit, we include it into the built number if(IsCharDigit(szDataBegin[0])) { dwBuildNumber = (dwBuildNumber * 10) + (szDataBegin[0] - '0'); @@ -539,9 +539,12 @@ static DWORD LoadBuildNumber(TCascStorage * hs, const char * /* szVariableName * szDataBegin++; } - // If not there, just take value from build file - if((hs->dwBuildNumber = dwMaxValue) == 0) - hs->dwBuildNumber = hs->CdnBuildKey.pbData[0] % 100; + // If we don't have a build number yet, take the max value, if any + if(hs->dwBuildNumber == 0 && dwMaxValue >= 100) + { + hs->dwBuildNumber = dwMaxValue; + return ERROR_SUCCESS; + } return ERROR_BAD_FORMAT; } |