diff --git a/core/HalfLife2.cpp b/core/HalfLife2.cpp index dfbaf6209..983894268 100644 --- a/core/HalfLife2.cpp +++ b/core/HalfLife2.cpp @@ -831,6 +831,14 @@ const char *CHalfLife2::CurrentCommandName() void CHalfLife2::AddDelayedKick(int client, int userid, const char *msg) { + CPlayer *pPlayer = g_Players.GetPlayerByIndex(client); + if (!pPlayer || !pPlayer->IsConnected() || pPlayer->IsInKickQueue()) + { + return; + } + + pPlayer->MarkAsBeingKicked(); + DelayedKickInfo kick; kick.client = client; diff --git a/core/smn_player.cpp b/core/smn_player.cpp index ca3f8416f..c77525955 100644 --- a/core/smn_player.cpp +++ b/core/smn_player.cpp @@ -1400,7 +1400,6 @@ static cell_t KickClient(IPluginContext *pContext, const cell_t *params) return 1; } - pPlayer->MarkAsBeingKicked(); g_HL2.AddDelayedKick(client, pPlayer->GetUserId(), buffer); return 1;