From 7e0c0d79bcec0640884f8704b9f13491f8d9910d Mon Sep 17 00:00:00 2001 From: systematicmania Date: Thu, 18 Jul 2013 11:38:04 -0400 Subject: [PATCH] Fixed clients not being marked as in kick queue in some cases (bug 5746, r=psychonic). --- core/HalfLife2.cpp | 8 ++++++++ core/smn_player.cpp | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/core/HalfLife2.cpp b/core/HalfLife2.cpp index 57e65941..ab2765a1 100644 --- a/core/HalfLife2.cpp +++ b/core/HalfLife2.cpp @@ -897,6 +897,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 acb974db..d803c1d0 100644 --- a/core/smn_player.cpp +++ b/core/smn_player.cpp @@ -1404,7 +1404,6 @@ static cell_t KickClient(IPluginContext *pContext, const cell_t *params) return 1; } - pPlayer->MarkAsBeingKicked(); g_HL2.AddDelayedKick(client, pPlayer->GetUserId(), buffer); return 1;