From 33b96e6c5c96e5094b11da1d31d0334aee29a200 Mon Sep 17 00:00:00 2001 From: Solipsis23 <96273616+Solipsis23@users.noreply.github.com> Date: Sun, 24 Sep 2023 21:57:18 +0100 Subject: [PATCH] fast restart cmd made by jydenx --- hook_lib/Main.cpp | 6 ++++++ hook_lib/functions.cpp | 1 + hook_lib/functions.hpp | 1 + 3 files changed, 8 insertions(+) diff --git a/hook_lib/Main.cpp b/hook_lib/Main.cpp index 63f3e94..525d906 100644 --- a/hook_lib/Main.cpp +++ b/hook_lib/Main.cpp @@ -865,6 +865,11 @@ bool DDL_SetUInt_Detour(const DDLState* state, DDLContext* ddlContext, unsigned return ddl_setuint.stub(state, ddlContext, val); } +void SV_CmdsMP_FastRestart_f() { + auto SV_CmdsMP_RequestMapRestart = reinterpret_cast(0x14136C310_g); + SV_CmdsMP_RequestMapRestart(1, 0); +} + void* exception_handler_handle; BOOL WINAPI DllMain(HMODULE hModule, DWORD Reason, LPVOID lpVoid) { g_Addrs.ModuleBase = (uintptr_t)(GetModuleHandle(0)); @@ -904,6 +909,7 @@ BOOL WINAPI DllMain(HMODULE hModule, DWORD Reason, LPVOID lpVoid) { //Cmd_AddCommandInternal("view_vehicle_ents", Cmd_ViewVehicleEnts_f, &view_vehicle_ents_f_VAR); //Cmd_AddCommandInternal("loadout_save", Cmd_LoadoutSave_f, &loadout_save_f_VAR); Cmd_AddCommandInternal("loadout_save", SaveOperatorSkins, &loadout_save_f_VAR); + Cmd_AddCommandInternal("fast_restart", SV_CmdsMP_FastRestart_f, &FastRestart_f_VAR); // patch ui_maxclients limit utils::hook::nop(0x140F30210_g, 5); diff --git a/hook_lib/functions.cpp b/hook_lib/functions.cpp index ce7c41f..be31eb9 100644 --- a/hook_lib/functions.cpp +++ b/hook_lib/functions.cpp @@ -372,6 +372,7 @@ cmd_function_s ddldump_f_VAR; cmd_function_s weapondefdump_f_VAR; cmd_function_s view_vehicle_ents_f_VAR; cmd_function_s loadout_save_f_VAR; +cmd_function_s FastRestart_f_VAR; CmdArgs* cmd_args; diff --git a/hook_lib/functions.hpp b/hook_lib/functions.hpp index e920031..9eca864 100644 --- a/hook_lib/functions.hpp +++ b/hook_lib/functions.hpp @@ -125,6 +125,7 @@ extern cmd_function_s ddldump_f_VAR; extern cmd_function_s weapondefdump_f_VAR; extern cmd_function_s view_vehicle_ents_f_VAR; extern cmd_function_s loadout_save_f_VAR; +extern cmd_function_s FastRestart_f_VAR; extern CmdArgs* cmd_args; void* RtlAddVectoredExceptionHandler(LONG First, PVECTORED_EXCEPTION_HANDLER Handler);