diff --git a/hook_lib/game_inc.h b/hook_lib/game_inc.h index 17c35c2..3b87b85 100644 --- a/hook_lib/game_inc.h +++ b/hook_lib/game_inc.h @@ -12,7 +12,7 @@ #include "dvar.h" #include "stringed.h" #include "fastfile.h" -#include "party.h" +#include "mp_init.h" #include "ddl.h" #include "gamemode.h" #include "sv_main.h" diff --git a/hook_lib/hook_lib.vcxproj b/hook_lib/hook_lib.vcxproj index dc75e4a..893fe31 100644 --- a/hook_lib/hook_lib.vcxproj +++ b/hook_lib/hook_lib.vcxproj @@ -176,7 +176,7 @@ - + @@ -222,7 +222,7 @@ - + diff --git a/hook_lib/hook_lib.vcxproj.filters b/hook_lib/hook_lib.vcxproj.filters index da0c550..c6f5994 100644 --- a/hook_lib/hook_lib.vcxproj.filters +++ b/hook_lib/hook_lib.vcxproj.filters @@ -109,7 +109,7 @@ hook_lib\game - + hook_lib\game @@ -240,7 +240,7 @@ hook_lib\game - + hook_lib\game diff --git a/hook_lib/mp_init.cpp b/hook_lib/mp_init.cpp new file mode 100644 index 0000000..d2f7b48 --- /dev/null +++ b/hook_lib/mp_init.cpp @@ -0,0 +1,13 @@ +#include "mp_init.h" +#include "game_inc.h" + +void CG_MainMP_Init_Detour(int localClientNum, int serverMessageNum, int serverCommandSequence, int clientNum, void* hunkUser) +{ + cg_mainmp_init.stub(localClientNum, serverMessageNum, serverCommandSequence, clientNum, hunkUser); + + Cbuf_AddText("exec autoexec.cfg"); + + LoadInventory(); + + Cbuf_AddText("set cl_textChatEnabled 1"); +} \ No newline at end of file diff --git a/hook_lib/mp_init.h b/hook_lib/mp_init.h new file mode 100644 index 0000000..62654e9 --- /dev/null +++ b/hook_lib/mp_init.h @@ -0,0 +1,5 @@ +#pragma once +#include "Main.hpp" + +inline utils::hook::detour cg_mainmp_init; +void CG_MainMP_Init_Detour(int localClientNum, int serverMessageNum, int serverCommandSequence, int clientNum, void* hunkUser); \ No newline at end of file diff --git a/hook_lib/party.cpp b/hook_lib/party.cpp deleted file mode 100644 index 555edca..0000000 --- a/hook_lib/party.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "party.h" -#include "game_inc.h" - -void PartyHost_StartPrivateParty_Detour(int localClientNum, int localControllerIndex, bool currentlyActive, int hostType) -{ - Cbuf_AddText("exec autoexec.cfg"); - - partyhost_startprivateparty.stub(localClientNum, localControllerIndex, currentlyActive, hostType); - - LoadInventory(); - - Cbuf_AddText("set cl_textChatEnabled 1"); -} \ No newline at end of file diff --git a/hook_lib/party.h b/hook_lib/party.h deleted file mode 100644 index 49e4c9c..0000000 --- a/hook_lib/party.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once -#include "Main.hpp" - -inline utils::hook::detour partyhost_startprivateparty; -void PartyHost_StartPrivateParty_Detour(int localClientNum, int localControllerIndex, bool currentlyActive, int hostType); \ No newline at end of file diff --git a/hook_lib/patch.cpp b/hook_lib/patch.cpp index e416750..41d699a 100644 --- a/hook_lib/patch.cpp +++ b/hook_lib/patch.cpp @@ -137,7 +137,7 @@ void hooks() seh_stringed_getstring.create(0x1413CC2A0_g, SEH_StringEd_GetString_Detour); cl_createdevgui.create(0x1415B2080_g, CL_CreateDevGui_Detour); - partyhost_startprivateparty.create(0x14119F0D0_g, PartyHost_StartPrivateParty_Detour); + cg_mainmp_init.create(0x141792E60_g, CG_MainMP_Init_Detour); PM_WeaponUseAmmo.create(0x141155AF0_g, PM_WeaponUseAmmo_Detour);