From 92ac6147a1b85c71b3393e099e290b7f215561f1 Mon Sep 17 00:00:00 2001 From: Sestain Date: Mon, 16 Mar 2026 05:08:13 +0200 Subject: [PATCH] Fix game crashing if DLC has XMLVERSION paramater --- Minecraft.Client/Common/DLC/DLCManager.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Minecraft.Client/Common/DLC/DLCManager.cpp b/Minecraft.Client/Common/DLC/DLCManager.cpp index 931b0e1d9d..31e72b9823 100644 --- a/Minecraft.Client/Common/DLC/DLCManager.cpp +++ b/Minecraft.Client/Common/DLC/DLCManager.cpp @@ -400,6 +400,7 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD unsigned int uiParameterCount=*(unsigned int *)&pbData[uiCurrentByte]; 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;idwType] = type; } + + if (parameterName == L"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=*(unsigned int *)&pbData[uiCurrentByte]; uiCurrentByte+=sizeof(int); C4JStorage::DLC_FILE_DETAILS *pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];