Fix reconnect crashing

This commit is contained in:
fed 2022-10-11 00:10:24 +02:00
parent 7f91626c0d
commit 454b29f1c8
2 changed files with 7 additions and 13 deletions

View File

@ -34,11 +34,6 @@ namespace chat
utils::hook::inject(0x18A980_b, reinterpret_cast<void*>(0x2E6F588_b));
utils::hook::call(0x33EDEC_b, ui_get_font_handle_stub);
// set text style to 0 (non-blurry)
utils::hook::set<uint8_t>(0x18A9F2_b, 0);
utils::hook::set<uint8_t>(0x0F7151_b, 0);
utils::hook::set<uint8_t>(0x33EE0E_b, 0);
localized_strings::override("EXE_SAY", "^3Match^7");
localized_strings::override("EXE_SAYTEAM", "^5Team^7");

View File

@ -76,8 +76,11 @@ namespace party
perform_game_initialization();
// exit from virtuallobby
utils::hook::invoke<void>(0x13C9C0_b, 1);
if (game::VirtualLobby_Loaded())
{
// exit from virtuallobby
utils::hook::invoke<void>(0x13C9C0_b, 1);
}
// CL_ConnectFromParty
char session_info[0x100] = {};
@ -203,15 +206,11 @@ namespace party
game::DVAR_SOURCE_INTERNAL);
command::execute("vid_restart");
// set fs_game to the mod the server is on, "restart" game, and then (hopefully) reconnect
// set fs_game to the mod the server is on, "restart" game, and then reconnect
scheduler::once([=]()
{
command::execute("lui_open_popup popup_acceptinginvite", false);
// connecting too soon after vid_restart causes a crash ingame (awesome game)
scheduler::once([=]()
{
connect(target);
}, scheduler::pipeline::main, 5s);
connect(target);
}, scheduler::pipeline::main);
return true;