From d8357d0287421a7556c67ea95b21e0dedbd39a3e Mon Sep 17 00:00:00 2001 From: Lectem Date: Sun, 15 Dec 2024 23:45:45 +0100 Subject: [PATCH] Implement config functions --- D2.Detours.patches/1.10f/D2Client.patch.cpp | 3 +- D2.Detours.patches/1.10f/D2Common.patch.cpp | 2 +- source/D2Client/CMakeLists.txt | 2 + source/D2Client/include/CGAME/Game.h | 7 +- source/D2Client/include/Draw/Draw.h | 36 ++++ source/D2Client/src/Draw/Draw.cpp | 74 +++++++ source/D2Client/src/Game/Game.cpp | 190 +++++++++++++++++- .../D2Common/definitions/D2Common.1.10f.def | 2 +- source/D2Common/include/D2DataTbls.h | 2 +- source/D2Common/include/D2Log.h | 3 +- source/D2Common/src/D2Log.cpp | 4 +- source/D2Common/src/DataTbls/DataTbls.cpp | 4 +- source/D2CommonDefinitions/include/D2Config.h | 2 +- 13 files changed, 307 insertions(+), 24 deletions(-) create mode 100644 source/D2Client/include/Draw/Draw.h create mode 100644 source/D2Client/src/Draw/Draw.cpp diff --git a/D2.Detours.patches/1.10f/D2Client.patch.cpp b/D2.Detours.patches/1.10f/D2Client.patch.cpp index 80597179..a9b172ca 100644 --- a/D2.Detours.patches/1.10f/D2Client.patch.cpp +++ b/D2.Detours.patches/1.10f/D2Client.patch.cpp @@ -105,8 +105,7 @@ static ExtraPatchAction extraPatchActions[] = { { 0x6FAADD00 - D2ClientImageBase, &APPMODE_JoinGame, PatchAction::FunctionReplaceOriginalByPatch}, { 0x6FAAA4E0 - D2ClientImageBase, &APPMODE_Startup, PatchAction::FunctionReplaceOriginalByPatch}, - { 0x6FAABBF0 - D2ClientImageBase, &CONFIG_ApplyGameInformation, PatchAction::FunctionReplaceOriginalByPatch}, - { 0x6FAABC50 - D2ClientImageBase, &CONFIG_Apply_BattleNetIP, PatchAction::FunctionReplaceOriginalByPatch}, + { 0x6FAABEE0 - D2ClientImageBase, &ApplyConfiguration, PatchAction::FunctionReplaceOriginalByPatch}, { 0x6FAA2050 - D2ClientImageBase, &D2ClientEntrypoint, PatchAction::FunctionReplaceOriginalByPatch}, diff --git a/D2.Detours.patches/1.10f/D2Common.patch.cpp b/D2.Detours.patches/1.10f/D2Common.patch.cpp index 68a2ff8c..5fce280d 100644 --- a/D2.Detours.patches/1.10f/D2Common.patch.cpp +++ b/D2.Detours.patches/1.10f/D2Common.patch.cpp @@ -1143,7 +1143,7 @@ static PatchAction patchActions[GetOrdinalCount()] = { PatchAction::FunctionReplacePatchByOriginal, // D2Common_11099 @11099 PatchAction::FunctionReplaceOriginalByPatch, /*C*/ // LOG_11100 @11100 PatchAction::FunctionReplaceOriginalByPatch, /*C*/ // LOG_11101 @11101 - PatchAction::FunctionReplaceOriginalByPatch, /*C*/ // LOG_11102 @11102 + PatchAction::FunctionReplaceOriginalByPatch, /*C*/ // LOG_SetEnabled @11102 PatchAction::FunctionReplaceOriginalByPatch, /*C*/ // LOG_11103 @11103 PatchAction::FunctionReplaceOriginalByPatch, /*C*/ // LOG_11104 @11104 PatchAction::FunctionReplaceOriginalByPatch, /*C*/ // LOG_11105 @11105 diff --git a/source/D2Client/CMakeLists.txt b/source/D2Client/CMakeLists.txt index f90b8971..5c5dc144 100644 --- a/source/D2Client/CMakeLists.txt +++ b/source/D2Client/CMakeLists.txt @@ -39,10 +39,12 @@ target_sources(${D2ClientImplName} ) target_sources(${D2ClientImplName} PRIVATE + src/Draw/Draw.cpp src/Draw/dFloor.cpp src/Draw/dLightMap.cpp src/Draw/dWall.cpp + include/Draw/Draw.h include/Draw/dFloor.h include/Draw/dLightMap.h include/Draw/dWall.h diff --git a/source/D2Client/include/CGAME/Game.h b/source/D2Client/include/CGAME/Game.h index a673e964..aaaad36c 100644 --- a/source/D2Client/include/CGAME/Game.h +++ b/source/D2Client/include/CGAME/Game.h @@ -67,12 +67,6 @@ void __fastcall D2CLIENT_DrawGameScene(DWORD a1); //1.13c: D2Client.0x6FAF4B50 signed int __stdcall ClientGameLoop(int nIteration); -//1.10f: D2Client.0x6FAABBF0 -void __fastcall CONFIG_ApplyGameInformation(D2ConfigStrc* pConfig); - -//1.10f: D2Client.0x6FAABC50 -void __fastcall CONFIG_Apply_BattleNetIP(D2ConfigStrc* pConfig); - //1.10f: D2Client.0x6FAABEE0 BOOL __fastcall ApplyConfiguration(D2ConfigStrc* pConfig); @@ -112,3 +106,4 @@ BOOL __fastcall sub_6FAAB290(); BOOL __fastcall sub_6FAAB2E0(); //1.10f: D2Client.0x6FAAB320 BOOL __fastcall sub_6FAAB320(); + diff --git a/source/D2Client/include/Draw/Draw.h b/source/D2Client/include/Draw/Draw.h new file mode 100644 index 00000000..159c1fe5 --- /dev/null +++ b/source/D2Client/include/Draw/Draw.h @@ -0,0 +1,36 @@ +#pragma once + +#include +#include +#include + +//1.10f: 0x6FB6B7F6 (thunk for D2GFX_SetGamma) +void __fastcall DRAW_SetGamma(uint32_t nGamma); + + +//1.10f: D2Client.0x6FAABD30 +void __fastcall CONFIG_Apply_GDI(D2ConfigStrc* pConfig); + +//1.10f: D2Client.0x6FAABD40 +void __fastcall CONFIG_Apply_Glide(D2ConfigStrc* pConfig); + +//1.10f: D2Client.0x6FAABD50 +void __fastcall CONFIG_Apply_OpenGL(D2ConfigStrc* pConfig); + +//1.10f: D2Client.0x6FAABD60 +void __fastcall CONFIG_Apply_D3D(D2ConfigStrc* pConfig); + +//1.10f: D2Client.0x6FAABD70 +void __fastcall CONFIG_Apply_Rave(D2ConfigStrc* pConfig); + +//1.10f: D2Client.0x6FAA28C0 +DisplayType __fastcall CLIENT_GetDisplayType(); + +//1.10f: D2Client.0x6FAA28D0 +BOOL __fastcall CLIENT_IsDisplayType3D(); + +//1.10f: D2Client.0x6FAABD80 +void __fastcall CONFIG_Apply_Gamma(D2ConfigStrc* pConfig); + +//1.10f: D2Client.0x6FAABD90 +void __fastcall CONFIG_Apply_VSync(D2ConfigStrc* pConfig); \ No newline at end of file diff --git a/source/D2Client/src/Draw/Draw.cpp b/source/D2Client/src/Draw/Draw.cpp new file mode 100644 index 00000000..fe58d2a8 --- /dev/null +++ b/source/D2Client/src/Draw/Draw.cpp @@ -0,0 +1,74 @@ +#include +#include +#include + +#ifdef D2_VERSION_110F + +D2VAR(D2CLIENT, pgDisplayType, DisplayType, 0x6FB74970 - D2ClientImageBase); + +//1.10f: D2Client.0x6FB9A968 +static BOOL gbAskedForGDI = FALSE; // Unused ? +//1.10f: D2Client.0x6FAABD30 +void __fastcall CONFIG_Apply_GDI(D2ConfigStrc* pConfig) +{ + if (pConfig->bWindow) + { + *D2CLIENT_pgDisplayType = DISPLAYTYPE_GDI; + gbAskedForGDI = TRUE; + } +} + + +//1.10f: D2Client.0x6FAABD40 +void __fastcall CONFIG_Apply_Glide(D2ConfigStrc* pConfig) +{ + if (pConfig->b3DFX) *D2CLIENT_pgDisplayType = DISPLAYTYPE_GLIDE; +} +//1.10f: D2Client.0x6FAABD50 +void __fastcall CONFIG_Apply_OpenGL(D2ConfigStrc* pConfig) +{ + if (pConfig->bOpenGL) *D2CLIENT_pgDisplayType = DISPLAYTYPE_OPENGL; +} +//1.10f: D2Client.0x6FAABD60 +void __fastcall CONFIG_Apply_D3D(D2ConfigStrc* pConfig) +{ + if (pConfig->bD3D) *D2CLIENT_pgDisplayType = DISPLAYTYPE_DIRECT3D; +} + +//1.10f: D2Client.0x6FAABD70 +void __fastcall CONFIG_Apply_Rave(D2ConfigStrc* pConfig) +{ + if (pConfig->bRave) *D2CLIENT_pgDisplayType = DISPLAYTYPE_RAVE; +} + +//1.10f: D2Client.0x6FAA28C0 +DisplayType __fastcall CLIENT_GetDisplayType() +{ + return *D2CLIENT_pgDisplayType; +} + +//1.10f: D2Client.0x6FAA28D0 +BOOL __fastcall CLIENT_IsDisplayType3D() +{ + return *D2CLIENT_pgDisplayType >= DISPLAYTYPE_GLIDE; +} + +//1.10f: D2Client.0x6FAABD80 +void __fastcall CONFIG_Apply_Gamma(D2ConfigStrc* pConfig) +{ + if (pConfig->dwGamma != 0) DRAW_SetGamma(pConfig->dwGamma); +} + +//1.10f: D2Client.0x6FAABD90 +void __fastcall CONFIG_Apply_VSync(D2ConfigStrc* pConfig) +{ + if (pConfig->bVSync) D2GFX_EnableVSync(); +} + +void __fastcall DRAW_SetGamma(uint32_t nGamma) +{ + D2GFX_SetGamma(nGamma); +} + + +#endif \ No newline at end of file diff --git a/source/D2Client/src/Game/Game.cpp b/source/D2Client/src/Game/Game.cpp index d9d34f2f..a323d5be 100644 --- a/source/D2Client/src/Game/Game.cpp +++ b/source/D2Client/src/Game/Game.cpp @@ -36,6 +36,10 @@ #include #include #include +#include +#include +#include +#include #ifdef D2_VERSION_110F @@ -93,6 +97,8 @@ D2CLIENTSTUB(sub, 6FAB7C50, void, __fastcall, (int* a1, int* a2)); D2VAR(D2CLIENT, pgbAppliedConfiguration, BOOL, 0x6FB759E4 - D2ClientImageBase); D2PTR(D2CLIENT, pgpConfigComInterface_6FBA7944, BnClientInterface*, 0x6FBA7944 - D2ClientImageBase); +D2VAR(D2CLIENT, peConfigCharacterPlayerClass, uint32_t, 0x6FBA7894 - D2ClientImageBase); +D2VAR(D2CLIENT, pgszPlayerName, char, 0x6FBA7810 - D2ClientImageBase);//16 bytes D2VAR(D2CLIENT, pgpView_6FBA7990, D2GameViewStrc*, 0x6FBA7990 - D2ClientImageBase); D2CLIENTDWORDSTUB(6FB758D8); D2CLIENTDWORDSTUB(6FB758DC); @@ -139,6 +145,8 @@ D2VAR(D2CLIENT, pgpCurrentAct_6FBA7984, D2DrlgActStrc*, 0x6FBA7984 - D2ClientIma D2CLIENTDWORDSTUB(6FBA79A8); D2CLIENTDWORDSTUB(6FB7580C); +D2CLIENTDWORDSTUB(6FB751B4); +D2VAR(D2CLIENT, pdwCTemp_6FB751B8, DWORD, 0x6FB751B8 - D2ClientImageBase); // 1.13c:0x6FBCC3A0 D2VAR(D2CLIENT, pgbIsInGame_6FBA796C, DWORD, 0x6FBA796C - D2ClientImageBase); // 1.13c:0x6FBCC3A0 D2CLIENTDWORDSTUB(6FBA79B0); @@ -1269,12 +1277,26 @@ BOOL __fastcall sub_6FAAB320() } -//1.10f: D2Client.0x6FB75570 -char gszBattleNetIP[D2_MAX_PATH] = "207.82.87.139"; +//1.10f: D2Client.0x6FAABB70 +void __fastcall CONFIG_Apply_bNoSave(D2ConfigStrc* pConfig) +{ + if (pConfig->bNoSave) + D2GAME_10036_PLRSAVE_EnableSaveFileWriting(0); +} + +//1.10f: D2Client.0x6FAABB90 +void __fastcall CONFIG_Apply_Act(D2ConfigStrc* pConfig) +{ + if (pConfig->dwAct) + { + D2_ASSERT(pConfig->dwAct < NUM_ACTS + 1); + D2_ASSERT(pConfig->dwAct > 0); + GAME_SetGlobalAct(pConfig->dwAct - 1); + } +} //1.10f: D2Client.0x6FB75468 char gszServerIP[D2_MAX_PATH] = "207.82.87.243"; - //1.10f: D2Client.0x6FAABBF0 void __fastcall CONFIG_ApplyGameInformation(D2ConfigStrc* pConfig) { @@ -1286,6 +1308,8 @@ void __fastcall CONFIG_ApplyGameInformation(D2ConfigStrc* pConfig) *D2CLIENT_pgnTokenId = pConfig->nTokenId; } +//1.10f: D2Client.0x6FB75570 +char gszBattleNetIP[D2_MAX_PATH] = "207.82.87.139"; //1.10f: D2Client.0x6FAABC50 void __fastcall CONFIG_Apply_BattleNetIP(D2ConfigStrc* pConfig) { @@ -1293,16 +1317,168 @@ void __fastcall CONFIG_Apply_BattleNetIP(D2ConfigStrc* pConfig) lstrcpyA(gszBattleNetIP, pConfig->szServerIP); } -using ConfigSetupFunction = BOOL(__fastcall*)(D2ConfigStrc* pConfig); -D2VAR(D2CLIENT, paConfigSetupFunctions, ConfigSetupFunction, 0x6FB759E8 - D2ClientImageBase); +//1.10f: D2Client.0x6FB75570 +char gszMCPIP[D2_MAX_PATH] = "207.82.87.133"; +//1.10f: D2Client.0x6FAABC80 +void __fastcall CONFIG_Apply_MCPIP(D2ConfigStrc* pConfig) +{ + if (strcmp(pConfig->szMCPIP, "0")) + lstrcpyA(gszMCPIP, pConfig->szMCPIP); +} + + +//1.10f: D2Client.0x6FAABCB0 +void __fastcall CONFIG_Apply_CharClass(D2ConfigStrc* pConfig) +{ + if (pConfig->bAmazon) *D2CLIENT_peConfigCharacterPlayerClass = PCLASS_AMAZON; + if (pConfig->bPaladin) *D2CLIENT_peConfigCharacterPlayerClass = PCLASS_PALADIN; + if (pConfig->bSorceress) *D2CLIENT_peConfigCharacterPlayerClass = PCLASS_SORCERESS; + if (pConfig->bNecromancer) *D2CLIENT_peConfigCharacterPlayerClass = PCLASS_NECROMANCER; + if (pConfig->bBarbarian) *D2CLIENT_peConfigCharacterPlayerClass = PCLASS_BARBARIAN; + if (pConfig->bDruid) *D2CLIENT_peConfigCharacterPlayerClass = PCLASS_DRUID; + if (pConfig->bAssassin) *D2CLIENT_peConfigCharacterPlayerClass = PCLASS_ASSASSIN; +} + + +//1.10f: D2Client.0x6FAABDA0 +void __fastcall CONFIG_Apply_Log(D2ConfigStrc* pConfig) +{ + if (pConfig->bLog) LOG_SetEnabled(TRUE); +} + +//1.10f: D2Client.0x6FAABDC0 +void __fastcall CONFIG_Apply_Seed(D2ConfigStrc* pConfig) +{ + if (pConfig->dwSeed) GAME_SetInitSeed(pConfig->dwSeed); +} + +//1.10f: D2Client.0x6FAABDE0 +void __fastcall CONFIG_Apply_PlrName(D2ConfigStrc* pConfig) +{ + if (strcmp(pConfig->szName, "0") != 0) + { + const size_t nBufferLen = 16; + memset(D2CLIENT_pgszPlayerName, 0, 16); +#ifdef NO_BUG_FIX + int nBufferLen = strlen(pConfig->szName) + 1; + if (nBufferLen > 16) + nBufferLen = 16; + strncpy(D2CLIENT_pgszPlayerName, pConfig->szName, nBufferLen); +#else // Original code would not mandate a null terminated string, but the game assumes it is. Classic strncpy misuse. + strncpy(D2CLIENT_pgszPlayerName, pConfig->szName, nBufferLen - 1); +#endif + } +} + +//1.10f: D2Client.0x6FBA77F0 +char gszRealm[32]; +//1.10f: D2Client.0x6FAABE40 +void __fastcall CONFIG_Apply_Realm(D2ConfigStrc* pConfig) +{ + SStrCopy(gszRealm, pConfig->szRealm, ARRAY_SIZE(gszRealm)); +} + +//1.10f: D2Client.0x6FAABE60 +void __fastcall CONFIG_Apply_UnkFlag(D2ConfigStrc* pConfig) +{ + *D2CLIENT_pdword_6FB751B4 |= 1u; +} + +//1.10f: D2Client.0x6FAABE70 +void __fastcall CONFIG_Apply_CTemp(D2ConfigStrc* pConfig) +{ + *D2CLIENT_pdwCTemp_6FB751B8 = pConfig->unpackedCTemp.nUnk; +} + +//1.10f: D2Client.0x6FAABE80 +void __fastcall CONFIG_ApplyComInterface(D2ConfigStrc* pConfig) +{ + if (pConfig->pComInterface) *D2CLIENT_pgpConfigComInterface_6FBA7944 = pConfig->pComInterface; +} + +//1.10f: D2Client.0x6FAABEA0 +void __fastcall CONFIG_Apply_NoCompress(D2ConfigStrc* pConfig) +{ + // Apparently inverted? + if (pConfig->bNoCompress) D2CMP_SetCompressedDataMode(pConfig->bNoCompress); +} + +//1.10f: D2Client.0x6FAABEC0 +void __fastcall CONFIG_Apply_Txt(D2ConfigStrc* pConfig) +{ + DATATBLS_ToggleCompileTxtFlag(pConfig->bTxt == 0); +} + +//1.10f:D2Client.0x6FAABE90 +void __fastcall CONFIG_Noop(D2ConfigStrc* pConfig){} + +using ConfigSetupFunction = void(__fastcall*)(D2ConfigStrc* pConfig); +//1.10f: D2Client.0x6FB759E8 +ConfigSetupFunction aConfigSetupFunctions[] = +{ + CONFIG_Apply_GDI, + CONFIG_Apply_Glide, + CONFIG_Apply_OpenGL, + CONFIG_Apply_D3D, + CONFIG_Apply_Rave, + CONFIG_Noop, + CONFIG_Apply_Gamma, + CONFIG_Apply_VSync, + CONFIG_Noop, + CONFIG_ApplyGameInformation, + CONFIG_ApplyGameInformation, + CONFIG_ApplyGameInformation, + CONFIG_ApplyGameInformation, + CONFIG_ApplyGameInformation, + CONFIG_Apply_BattleNetIP, + CONFIG_Apply_MCPIP, + CONFIG_Apply_CharClass, + CONFIG_Apply_CharClass, + CONFIG_Apply_CharClass, + CONFIG_Apply_CharClass, + CONFIG_Apply_CharClass, + CONFIG_Noop, + CONFIG_Apply_PlrName, + CONFIG_Apply_Realm, + CONFIG_Apply_CTemp, + CONFIG_Noop, + CONFIG_Noop, + CONFIG_Noop, + CONFIG_Noop, + CONFIG_Noop, + CONFIG_Apply_Act, + CONFIG_Apply_Log, + CONFIG_Noop, + CONFIG_Apply_bNoSave, + CONFIG_Apply_Seed, + CONFIG_Apply_UnkFlag, + CONFIG_Noop, + CONFIG_Noop, + CONFIG_Noop, + CONFIG_Noop, + nullptr, + CONFIG_Noop, + CONFIG_Noop, + CONFIG_ApplyComInterface, + CONFIG_ApplyGameInformation, + nullptr, + CONFIG_Apply_NoCompress, + CONFIG_Apply_Txt, +}; +#ifdef D2_VERSION_110F +static_assert(ARRAY_SIZE(aConfigSetupFunctions) == 48, "There are 48 config functions in the original game"); +#endif//D2_VERSION_110F + //1.10f: D2Client.0x6FAABEE0 BOOL __fastcall ApplyConfiguration(D2ConfigStrc* pConfig) { *D2CLIENT_pgbAppliedConfiguration = TRUE; - for (int i = 0; i < 48; ++i) + for (const auto setupFunc : aConfigSetupFunctions) { - if (const auto setupFunc = D2CLIENT_paConfigSetupFunctions[i]) + if (setupFunc) + { setupFunc(pConfig); + } } return *D2CLIENT_pgbAppliedConfiguration; } diff --git a/source/D2Common/definitions/D2Common.1.10f.def b/source/D2Common/definitions/D2Common.1.10f.def index dd301d03..8efb826d 100644 --- a/source/D2Common/definitions/D2Common.1.10f.def +++ b/source/D2Common/definitions/D2Common.1.10f.def @@ -1102,7 +1102,7 @@ EXPORTS D2Common_11099 @11099 LOG_11100 @11100 LOG_11101 @11101 - LOG_11102 @11102 + LOG_SetEnabled @11102 LOG_11103 @11103 LOG_11104 @11104 LOG_11105 @11105 diff --git a/source/D2Common/include/D2DataTbls.h b/source/D2Common/include/D2DataTbls.h index c9e3c05e..f8a2d0ab 100644 --- a/source/D2Common/include/D2DataTbls.h +++ b/source/D2Common/include/D2DataTbls.h @@ -596,7 +596,7 @@ D2COMMON_DLL_DECL void __stdcall DATATBLS_WriteBinFile(char* szFileName, void* p //D2Common.0x6FD4FD70 (#10578) D2COMMON_DLL_DECL void* __stdcall DATATBLS_CompileTxt(HD2ARCHIVE hArchive, const char* szName, D2BinFieldStrc* pTbl, int* pRecordCount, size_t dwSize); //D2Common.0x6FD500F0 (#11242) -D2COMMON_DLL_DECL void __stdcall DATATBLS_ToggleCompileTxtFlag(BOOL bSilent); +D2COMMON_DLL_DECL void __stdcall DATATBLS_ToggleCompileTxtFlag(BOOL bNoTxt); //D2Common.0x6FD50110 (#10579) D2COMMON_DLL_DECL void __stdcall DATATBLS_UnloadBin(void* pBinFile); //D2Common.0x6FD50150 (#10575) diff --git a/source/D2Common/include/D2Log.h b/source/D2Common/include/D2Log.h index 7a3a4b40..4474e0ef 100644 --- a/source/D2Common/include/D2Log.h +++ b/source/D2Common/include/D2Log.h @@ -1,8 +1,9 @@ #pragma once +#include void __cdecl LOG_11100(int a1, int a2, int a3, int a4, const char* szFile, int nLine, const char* szFormat, ...); void __cdecl LOG_11101(int nGame, int nFrame, int nClient, int a4, int nSize, const char* szFormat, ...); -void __fastcall LOG_11102(void* a1); +void __fastcall LOG_SetEnabled(BOOL bEnabled); void __fastcall LOG_11103(void* a1); void __fastcall LOG_11104(void* a1); void __cdecl LOG_11105(); diff --git a/source/D2Common/src/D2Log.cpp b/source/D2Common/src/D2Log.cpp index 75564292..e4d39f3e 100644 --- a/source/D2Common/src/D2Log.cpp +++ b/source/D2Common/src/D2Log.cpp @@ -14,9 +14,9 @@ void __cdecl LOG_11101(int nGame, int nFrame, int nClient, int a4, int nSize, co REMOVE_LATER_Trace("LOG_11101: Useless"); } -void __fastcall LOG_11102(void* a1) +void __fastcall LOG_SetEnabled(BOOL bEnabled) { - REMOVE_LATER_Trace("LOG_11102: Useless"); + REMOVE_LATER_Trace("LOG_SetEnabled: Useless"); } void __fastcall LOG_11103(void* a1) diff --git a/source/D2Common/src/DataTbls/DataTbls.cpp b/source/D2Common/src/DataTbls/DataTbls.cpp index 30caa97d..3d0a6499 100644 --- a/source/D2Common/src/DataTbls/DataTbls.cpp +++ b/source/D2Common/src/DataTbls/DataTbls.cpp @@ -690,9 +690,9 @@ void* __stdcall DATATBLS_CompileTxt(HD2ARCHIVE hArchive, const char* szName, D2B } //D2Common.0x6FD500F0 (#11242) -void __stdcall DATATBLS_ToggleCompileTxtFlag(BOOL bSilent) +void __stdcall DATATBLS_ToggleCompileTxtFlag(BOOL bNoTxt) { - sgptDataTables->bCompileTxt = !bSilent; + sgptDataTables->bCompileTxt = !bNoTxt; } //D2Common.0x6FD50110 (#10579) diff --git a/source/D2CommonDefinitions/include/D2Config.h b/source/D2CommonDefinitions/include/D2Config.h index e4cd8ba3..21080a44 100644 --- a/source/D2CommonDefinitions/include/D2Config.h +++ b/source/D2CommonDefinitions/include/D2Config.h @@ -95,7 +95,7 @@ struct D2ConfigStrc uint8_t bRare; uint8_t bUnique; uint8_t _01DA[2]; // Possibly Set/Magic - uint32_t dwAct; + int32_t dwAct; uint8_t bNoPreload; uint8_t bDirect; uint8_t bLowEnd;