diff --git a/deps/fmt b/deps/fmt index 8c63ea43..6d9e4d33 160000 --- a/deps/fmt +++ b/deps/fmt @@ -1 +1 @@ -Subproject commit 8c63ea432c7985eb056f1457d7edc8574d4fa2f8 +Subproject commit 6d9e4d330c5845436dca7a32154176212ebbd4a4 diff --git a/deps/mongoose b/deps/mongoose index 92b15395..b39e30fb 160000 --- a/deps/mongoose +++ b/deps/mongoose @@ -1 +1 @@ -Subproject commit 92b15395a43e0fcdfcf094e519798a0a1cae2b1c +Subproject commit b39e30fb0cbed1b91a205903fc6f8956a9e58c32 diff --git a/src/Components/Modules/Exception.cpp b/src/Components/Modules/Exception.cpp index a69501c1..f014069a 100644 --- a/src/Components/Modules/Exception.cpp +++ b/src/Components/Modules/Exception.cpp @@ -99,30 +99,21 @@ namespace Components Command::Add("mapTest", [](Command::Params params) { + Game::UI_UpdateArenas(); + std::string command; - - int max = (params.Length() >= 2 ? atoi(params[1]) : 16), current = 0; - - for (int i = 0;;) + for (int i = 0; i < (params.Length() >= 2 ? atoi(params[1]) : *Game::arenaCount); ++i) { - char* mapname = Game::mapnames[i]; - if (!*mapname) - { - i = 0; - continue; - } + char* mapname = ArenaLength::NewArenas[i % *Game::arenaCount].mapName; if (!(i % 2)) command.append(fmt::sprintf("wait 250;disconnect;wait 750;", mapname)); // Test a disconnect - else command.append(fmt::sprintf("wait 500;", mapname)); // Test direct map switch + else command.append(fmt::sprintf("wait 500;", mapname)); // Test direct map switch command.append(fmt::sprintf("map %s;", mapname)); - - ++i, ++current; - - if (current >= max) break; } Command::Execute(command, false); }); + Command::Add("debug_exceptionhandler", [](Command::Params) { Logger::Print("Rerunning SetUnhandledExceptionHandler...\n"); diff --git a/src/Components/Modules/Maps.cpp b/src/Components/Modules/Maps.cpp index 37db0ecc..56e9b606 100644 --- a/src/Components/Modules/Maps.cpp +++ b/src/Components/Modules/Maps.cpp @@ -151,27 +151,16 @@ namespace Components } } - Game::GameMap_Data** Maps::GetWorldData() + Game::GameMap_Data* Maps::GetWorldData() { - Game::XAssetType type = Game::XAssetType::ASSET_TYPE_GAME_MAP_MP; - if (Utils::String::StartsWith(Maps::CurrentMainZone, "mp_") || Maps::IsSPMap) + if (!Utils::String::StartsWith(Maps::CurrentMainZone, "mp_") || Maps::IsSPMap) { - type = Game::XAssetType::ASSET_TYPE_GAME_MAP_SP; + return Game::DB_XAssetPool[Game::XAssetType::ASSET_TYPE_GAME_MAP_SP].gameMapSP[0].data; + } + else + { + return Game::DB_XAssetPool[Game::XAssetType::ASSET_TYPE_GAME_MAP_MP].gameMapMP[0].data; } - - return &(Game::DB_XAssetPool[Game::XAssetType::ASSET_TYPE_GAME_MAP_MP].gameMapMP[0].data); - } - - __declspec(naked) void Maps::GetWorldDataStub() - { - __asm - { - mov eax, 46AC30h - call eax - - call Maps::GetWorldData - retn - } } void Maps::GetBSPName(char* buffer, size_t size, const char* format, const char* mapname) @@ -507,8 +496,7 @@ namespace Components Utils::Hook(0x444810, Maps::IgnoreEntityStub, HOOK_JUMP).Install()->Quick(); // WorldData pointer replacement - Utils::Hook::Nop(0x4D90B6, 5); - Utils::Hook(0x4D90B1, Maps::GetWorldDataStub, HOOK_CALL).Install()->Quick(); + Utils::Hook(0x4D90B6, Maps::GetWorldData, HOOK_CALL).Install()->Quick(); Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_GAME_MAP_SP, 1); Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_IMAGE, 7168); diff --git a/src/Components/Modules/Maps.hpp b/src/Components/Modules/Maps.hpp index 27ec5fa0..f7bad4ee 100644 --- a/src/Components/Modules/Maps.hpp +++ b/src/Components/Modules/Maps.hpp @@ -40,8 +40,7 @@ namespace Components static int IgnoreEntityStub(const char* entity); - static Game::GameMap_Data** GetWorldData(); - static void GetWorldDataStub(); + static Game::GameMap_Data* GetWorldData(); static void AddDlc(DLC dlc); static void UpdateDlcStatus(); diff --git a/src/Game/Functions.cpp b/src/Game/Functions.cpp index 714ac806..3e01e4d4 100644 --- a/src/Game/Functions.cpp +++ b/src/Game/Functions.cpp @@ -224,6 +224,7 @@ namespace Game UI_AddMenuList_t UI_AddMenuList = (UI_AddMenuList_t)0x4533C0; UI_CheckStringTranslation_t UI_CheckStringTranslation = (UI_CheckStringTranslation_t)0x4FB010; UI_LoadMenus_t UI_LoadMenus = (UI_LoadMenus_t)0x641460; + UI_UpdateArenas_t UI_UpdateArenas = (UI_UpdateArenas_t)0x4A95B0; UI_DrawHandlePic_t UI_DrawHandlePic = (UI_DrawHandlePic_t)0x4D0EA0; UI_GetContext_t UI_GetContext = (UI_GetContext_t)0x4F8940; UI_TextWidth_t UI_TextWidth = (UI_TextWidth_t)0x6315C0; diff --git a/src/Game/Functions.hpp b/src/Game/Functions.hpp index fef65f63..88b40454 100644 --- a/src/Game/Functions.hpp +++ b/src/Game/Functions.hpp @@ -527,6 +527,9 @@ namespace Game typedef MenuList *(__cdecl * UI_LoadMenus_t)(const char *menuFile, int imageTrack); extern UI_LoadMenus_t UI_LoadMenus; + typedef void(__cdecl * UI_UpdateArenas_t)(); + extern UI_UpdateArenas_t UI_UpdateArenas; + typedef void(__cdecl * UI_DrawHandlePic_t)(/*ScreenPlacement*/void *scrPlace, float x, float y, float w, float h, int horzAlign, int vertAlign, const float *color, Material *material); extern UI_DrawHandlePic_t UI_DrawHandlePic;