From eb76e7d323322814873493aa8d6ea9a6d858a071 Mon Sep 17 00:00:00 2001 From: marqdevx Date: Mon, 4 Mar 2024 10:41:25 +0100 Subject: [PATCH] Remove coach on disconnect --- src/cs2fixes.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cs2fixes.cpp b/src/cs2fixes.cpp index 6b00e849..303c42ce 100644 --- a/src/cs2fixes.cpp +++ b/src/cs2fixes.cpp @@ -525,6 +525,13 @@ void CS2Fixes::Hook_ClientDisconnect( CPlayerSlot slot, ENetworkDisconnectionRea Message( "Hook_ClientDisconnect(%d, %d, \"%s\", %lli, \"%s\")\n", slot, reason, pszName, xuid, pszNetworkID ); g_playerManager->OnClientDisconnect(slot); + + if (coaches.Count() < 1) return; + FOR_EACH_VEC(coaches,i){ + if(coaches[i]->GetPlayerSlot() == slot.Get()){ + coaches.Remove(i); + } + } } void CS2Fixes::Hook_GameFrame( bool simulating, bool bFirstTick, bool bLastTick )