From aa89132770c0097ea59824bcb4f644dd9c00066e Mon Sep 17 00:00:00 2001 From: momo5502 Date: Mon, 19 Sep 2016 21:16:26 +0200 Subject: [PATCH] Fix map looping --- deps/protobuf | 2 +- src/Components/Modules/Maps.cpp | 4 ++-- src/Components/Modules/Maps.hpp | 2 +- src/Components/Modules/Zones.cpp | 22 +++++++++++----------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/deps/protobuf b/deps/protobuf index c44ca26f..7b00595d 160000 --- a/deps/protobuf +++ b/deps/protobuf @@ -1 +1 @@ -Subproject commit c44ca26fe89ed8a81d3ee475a2ccc1797141dbce +Subproject commit 7b00595ddf8622ae429ef37de8ea2f44b6333ad0 diff --git a/src/Components/Modules/Maps.cpp b/src/Components/Modules/Maps.cpp index 3e8a7a9a..a967aa3e 100644 --- a/src/Components/Modules/Maps.cpp +++ b/src/Components/Modules/Maps.cpp @@ -158,7 +158,7 @@ namespace Components Maps::DependencyList[expression] = zone; } - bool Maps::IgnoreEntityStub(const char* entity) + int Maps::IgnoreEntityStub(const char* entity) { return (Utils::String::StartsWith(entity, "dyn_") || Utils::String::StartsWith(entity, "node_") || Utils::String::StartsWith(entity, "actor_")); } @@ -223,7 +223,7 @@ namespace Components Utils::Hook(0x42C2AF, Maps::LoadMapZones, HOOK_CALL).Install()->Quick(); // Ignore SP entities - Utils::Hook(0x5FBD6E, Maps::IgnoreEntityStub, HOOK_CALL).Install()->Quick(); + Utils::Hook(0x444810, Maps::IgnoreEntityStub, HOOK_JUMP).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 a033ba3d..730e60b5 100644 --- a/src/Components/Modules/Maps.hpp +++ b/src/Components/Modules/Maps.hpp @@ -24,7 +24,7 @@ namespace Components static void OverrideMapEnts(Game::MapEnts* ents); - static bool IgnoreEntityStub(const char* entity); + static int IgnoreEntityStub(const char* entity); void ReallocateEntryPool(); }; diff --git a/src/Components/Modules/Zones.cpp b/src/Components/Modules/Zones.cpp index ed8b7c50..29608632 100644 --- a/src/Components/Modules/Zones.cpp +++ b/src/Components/Modules/Zones.cpp @@ -1077,17 +1077,17 @@ namespace Components void Zones::InstallPatches(int version) { Zones::ZoneVersion = version; -// AssetHandler::ClearRelocations(); -// -// if (Zones::ZoneVersion == VERSION_ALPHA2 || Zones::ZoneVersion == VERSION_ALPHA3 || Zones::ZoneVersion == XFILE_VERSION) -// { -// Utils::Hook::Set(0x4158F4, version); -// Utils::Hook::Set(0x4158FB, version); -// } -// -// PatchMW2_FifthInfinityApply(version, version >= 316); -// -// AntiCheat::EmptyHash(); + AssetHandler::ClearRelocations(); + + if (Zones::ZoneVersion == VERSION_ALPHA2 || Zones::ZoneVersion == VERSION_ALPHA3 || Zones::ZoneVersion == XFILE_VERSION) + { + Utils::Hook::Set(0x4158F4, version); + Utils::Hook::Set(0x4158FB, version); + } + + PatchMW2_FifthInfinityApply(version, version >= 316); + + AntiCheat::EmptyHash(); } Zones::Zones()