From bfb17dd71d7309b3a42f3446ff0afc4fe7c1be4f Mon Sep 17 00:00:00 2001 From: momo5502 Date: Tue, 1 Nov 2016 22:31:22 +0100 Subject: [PATCH] Maybe glass fix v9999? --- src/Components/Modules/Maps.cpp | 19 ++++++++++++++++++- src/Components/Modules/Maps.hpp | 1 + src/Components/Modules/Zones.cpp | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/Components/Modules/Maps.cpp b/src/Components/Modules/Maps.cpp index c8d806a2..57d686a9 100644 --- a/src/Components/Modules/Maps.cpp +++ b/src/Components/Modules/Maps.cpp @@ -175,6 +175,23 @@ namespace Components } } + __declspec(naked) void Maps::GetWorldDataStub() + { + __asm + { + push eax + pushad + + call Maps::GetWorldData + + mov [esp + 20h], eax + popad + pop eax + + retn + } + } + void Maps::GetBSPName(char* buffer, size_t size, const char* format, const char* mapname) { if (!Utils::String::StartsWith(mapname, "mp_") && !Utils::String::StartsWith(mapname, "zm_")) @@ -533,7 +550,7 @@ namespace Components Utils::Hook(0x444810, Maps::IgnoreEntityStub, HOOK_JUMP).Install()->Quick(); // WorldData pointer replacement - Utils::Hook(0x4D90B6, Maps::GetWorldData, HOOK_CALL).Install()->Quick(); + Utils::Hook(0x4D90B6, Maps::GetWorldDataStub, 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 637f1e42..db71242c 100644 --- a/src/Components/Modules/Maps.hpp +++ b/src/Components/Modules/Maps.hpp @@ -43,6 +43,7 @@ namespace Components static int IgnoreEntityStub(const char* entity); static Game::GameMap_Data* GetWorldData(); + static void GetWorldDataStub(); static void AddDlc(DLC dlc); static void UpdateDlcStatus(); diff --git a/src/Components/Modules/Zones.cpp b/src/Components/Modules/Zones.cpp index b84dd801..132087e7 100644 --- a/src/Components/Modules/Zones.cpp +++ b/src/Components/Modules/Zones.cpp @@ -1492,7 +1492,7 @@ namespace Components }, HOOK_CALL); Utils::Hook(0x4597DD, Zones::LoadStatement, HOOK_CALL).Install()->Quick(); - Utils::Hook(0x471A39, Zones::LoadWindowImage, HOOK_JUMP).Install()->Quick(); + //Utils::Hook(0x471A39, Zones::LoadWindowImage, HOOK_JUMP).Install()->Quick(); #ifdef DEBUG // Easy dirty disk debugging