Check if in game

This commit is contained in:
Federico Cecchetto 2021-02-18 18:10:54 +01:00
parent 1f257b9910
commit db1d9e01f3

View File

@ -220,12 +220,15 @@ namespace party
} }
void send_disconnect() void send_disconnect()
{
if (game::CL_IsCgameInitialized())
{ {
// CL_ForwardCommandToServer // CL_ForwardCommandToServer
reinterpret_cast<void (*)(int, const char*)>(0x14020B310)(0, "disconnect"); reinterpret_cast<void (*)(int, const char*)>(0x14020B310)(0, "disconnect");
// CL_WritePacket // CL_WritePacket
reinterpret_cast<void (*)(int)>(0x1402058F0)(0); reinterpret_cast<void (*)(int)>(0x1402058F0)(0);
} }
}
const auto disconnect_stub = utils::hook::assemble([](utils::hook::assembler& a) const auto disconnect_stub = utils::hook::assemble([](utils::hook::assembler& a)
{ {