From dde6c3ea647ea7fbbb9494db21733b2aa5df79d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Dami=C3=A1n=20Viano?= Date: Tue, 18 Jun 2024 09:31:32 -0300 Subject: [PATCH] Make sv_spectate to strictly forbid spectating, clients that can't join or are forcefully moved to spectating are kicked after g_maxplayers_spectator_blocktime. Fix #2884. --- qcsrc/server/client.qc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 6b2b73f1f..c97f09c77 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -2700,6 +2700,8 @@ void PlayerFrame (entity this) anticheat_prethink(this); // Check if spectating is allowed + if (!autocvar_sv_spectate) blockSpectators = 1; + if (blockSpectators && IS_REAL_CLIENT(this) && (IS_SPEC(this) || IS_OBSERVER(this)) && !INGAME(this) && time > (CS(this).spectatortime + autocvar_g_maxplayers_spectator_blocktime)) -- 2.39.2