diff --git a/src/Components/Modules/Bots.cpp b/src/Components/Modules/Bots.cpp index bc1dee8..2b46c2e 100644 --- a/src/Components/Modules/Bots.cpp +++ b/src/Components/Modules/Bots.cpp @@ -16,6 +16,13 @@ namespace Components { int cl_num = cl - Game::svs->clients; + if (cl->state < Game::CS_ACTIVE) + { + Game::SV_DropClient(cl, "EXE_DISCONNECTED"); + cl->state = Game::CS_FREE; + return; + } + Game::usercmd_t cmd = {}; cmd.serverTime = Game::svs->time; diff --git a/src/Game/Game.cpp b/src/Game/Game.cpp index 2f175c0..24ce6e2 100644 --- a/src/Game/Game.cpp +++ b/src/Game/Game.cpp @@ -68,5 +68,18 @@ namespace Game call func_loc; } } + + void SV_DropClient(Game::client_t* client, const char* reason) + { + int func_loc = 0x454750; + + __asm + { + push reason; + mov eax, client; + call func_loc; + add esp, 4; + } + } } diff --git a/src/Game/Game.hpp b/src/Game/Game.hpp index 78074c2..6ca460c 100644 --- a/src/Game/Game.hpp +++ b/src/Game/Game.hpp @@ -35,4 +35,5 @@ namespace Game void SV_ClientThink(Game::usercmd_s*, Game::client_t*); + void SV_DropClient(Game::client_t*, const char*); }