diff options
| author | Sestain <35299377+sestain@users.noreply.github.com> | 2026-03-27 22:11:27 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-27 15:11:27 -0500 |
| commit | 7447fabe0d8d97b42a6c9fb58ac121d2bb04372a (patch) | |
| tree | 7243060b9956840515ea1582563a626dadfd5b88 /Minecraft.Client/Common/DLC | |
| parent | 3c1166c45e3be1dc44f0ea83accb0408a24b2751 (diff) | |
Fix game crashing if DLC has XMLVERSION paramater (#1285)
* Fix game crashing if DLC has XMLVERSION paramater
* Better implementation of XMLVersion check
* Forgot to add type name to the list
* Removed extra newline
Diffstat (limited to 'Minecraft.Client/Common/DLC')
| -rw-r--r-- | Minecraft.Client/Common/DLC/DLCManager.cpp | 13 | ||||
| -rw-r--r-- | Minecraft.Client/Common/DLC/DLCManager.h | 3 |
2 files changed, 15 insertions, 1 deletions
diff --git a/Minecraft.Client/Common/DLC/DLCManager.cpp b/Minecraft.Client/Common/DLC/DLCManager.cpp index 88a7756e..c363becf 100644 --- a/Minecraft.Client/Common/DLC/DLCManager.cpp +++ b/Minecraft.Client/Common/DLC/DLCManager.cpp @@ -10,6 +10,7 @@ const WCHAR *DLCManager::wchTypeNamesA[]= { + L"XMLVERSION", L"DISPLAYNAME", L"THEMENAME", L"FREE", @@ -405,6 +406,7 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD unsigned int uiParameterCount=readUInt32(&pbData[uiCurrentByte], bSwapEndian); uiCurrentByte+=sizeof(int); C4JStorage::DLC_FILE_PARAM *pParams = (C4JStorage::DLC_FILE_PARAM *)&pbData[uiCurrentByte]; + bool bXMLVersion = false; //DWORD dwwchCount=0; for(unsigned int i=0;i<uiParameterCount;i++) { @@ -421,11 +423,22 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD if( type != e_DLCParamType_Invalid ) { parameterMapping[pParams->dwType] = type; + + if (type == e_DLCParamType_XMLVersion) + { + bXMLVersion = true; + } } uiCurrentByte+= sizeof(C4JStorage::DLC_FILE_PARAM)+(pParams->dwWchCount*sizeof(WCHAR)); pParams = (C4JStorage::DLC_FILE_PARAM *)&pbData[uiCurrentByte]; } //ulCurrentByte+=ulParameterCount * sizeof(C4JStorage::DLC_FILE_PARAM); + + if (bXMLVersion) + { + uiCurrentByte += sizeof(int); + } + unsigned int uiFileCount=readUInt32(&pbData[uiCurrentByte], bSwapEndian); uiCurrentByte+=sizeof(int); C4JStorage::DLC_FILE_DETAILS *pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte]; diff --git a/Minecraft.Client/Common/DLC/DLCManager.h b/Minecraft.Client/Common/DLC/DLCManager.h index 7191ab0b..f114bd07 100644 --- a/Minecraft.Client/Common/DLC/DLCManager.h +++ b/Minecraft.Client/Common/DLC/DLCManager.h @@ -31,7 +31,8 @@ public: { e_DLCParamType_Invalid = -1, - e_DLCParamType_DisplayName = 0, + e_DLCParamType_XMLVersion = 0, + e_DLCParamType_DisplayName, e_DLCParamType_ThemeName, e_DLCParamType_Free, // identify free skins e_DLCParamType_Credit, // legal credits for DLC |
