From 6ab6f2cd625eb689f258fce04b51b8be688e4ac8 Mon Sep 17 00:00:00 2001 From: rackover Date: Mon, 5 Jul 2021 00:28:50 +0200 Subject: [PATCH] Remove extra fluff & useless comments --- src/Components/Modules/QuickPatch.cpp | 66 ++------------------------- src/Components/Modules/QuickPatch.hpp | 1 + 2 files changed, 4 insertions(+), 63 deletions(-) diff --git a/src/Components/Modules/QuickPatch.cpp b/src/Components/Modules/QuickPatch.cpp index 7e4d5bcd..b1320f9f 100644 --- a/src/Components/Modules/QuickPatch.cpp +++ b/src/Components/Modules/QuickPatch.cpp @@ -396,58 +396,7 @@ namespace Components return std::function < T >(reinterpret_cast(procAddr)); } - //int __cdecl G_ParseSpawnVars(Game::SpawnVar* spawnVar){ - // if (Zones::Version() >= VERSION_ALPHA2) { - // bool shouldBeRemoved = false; - - - // for (auto i = 0; i < spawnVar->numSpawnVars; i++) - // { - // char** kvPair = spawnVar->spawnVars[i]; - // auto key = kvPair[0]; - // auto val = kvPair[1]; - // - // bool isSpecOps = strncmp(key, "script_specialops", 16) == 0; - // bool isSpecOpsOnly = *val == 49; // 49 => Ascii "1" - - // if (isSpecOps && isSpecOpsOnly) { - // shouldBeRemoved = true; - // break; - // } - // } - - // if (shouldBeRemoved) { - // for (auto i = 0; i < spawnVar->numSpawnVars; i++) - // { - // char** kvPair = spawnVar->spawnVars[i]; - // auto key = kvPair[0]; - // auto val = kvPair[1]; - - // bool isClassName = strncmp(key, "classname", 9) == 0; - - // if (isClassName) { - // val = "dyn_lmao"; - // } - // } - // } - - // if (shouldBeRemoved) { - // spawnVar->numSpawnVars = 0; - // spawnVar->numSpawnVarChars = 0; - // spawnVar->spawnVarsValid = false; - - // //Components::Logger::Print("G_SpawnString: Removed %s\n", spawnVar->spawnVarChars); - // } - // } - // - // return Utils::Hook::Call(0x4B3410)(spawnVar); - //} - - BOOL __cdecl IsDynClassname(char* a1) { - //if (Zones::Version() >= VERSION_ALPHA2) { - bool shouldBeRemoved = false; - - + bool QuickPatch::IsDynClassnameStub(char* a1) { for (auto i = 0; i < Game::spawnVars->numSpawnVars; i++) { char** kvPair = Game::spawnVars->spawnVars[i]; @@ -462,15 +411,10 @@ namespace Components return true; // This will prevent spawning hopefully; } } - //} - return Utils::Hook::Call(0x444810)(a1); + return Utils::Hook::Call(0x444810)(a1); } - //void __cdecl G_SpawnItem(Game::gentity_s* a1, signed int a2) { - - //} - QuickPatch::QuickPatch() { QuickPatch::FrameTime = 0; @@ -514,11 +458,7 @@ namespace Components (0xC000007B /*0x0000000A*/, 0, nullptr, nullptr, OptionShutdownSystem, &response); }); - Utils::Hook(0x5FBD6E, IsDynClassname, HOOK_CALL).install()->quick(); - - //Utils::Hook(0x4D8845, G_ParseSpawnVars, HOOK_CALL).install()->quick(); - //Utils::Hook(0x4D8880, G_ParseSpawnVars, HOOK_CALL).install()->quick(); - //Utils::Hook(0x4D886A, G_ParseSpawnVars, HOOK_CALL).install()->quick(); + Utils::Hook(0x5FBD6E, QuickPatch::IsDynClassnameStub, HOOK_CALL).install()->quick(); // bounce dvar sv_enableBounces = Game::Dvar_RegisterBool("sv_enableBounces", false, Game::DVAR_FLAG_REPLICATED, "Enables bouncing on the server"); diff --git a/src/Components/Modules/QuickPatch.hpp b/src/Components/Modules/QuickPatch.hpp index 37402355..1b0c979b 100644 --- a/src/Components/Modules/QuickPatch.hpp +++ b/src/Components/Modules/QuickPatch.hpp @@ -47,5 +47,6 @@ namespace Components static void PlayerCollisionStub(); static Game::dvar_t* g_playerEjection; static void PlayerEjectionStub(); + static bool IsDynClassnameStub(char* a1); }; }