From 138941d929cd431b69ffc3ef14fcf6e0d3af4285 Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 17 Aug 2021 19:00:44 +0200 Subject: [PATCH] Avoid repeating a couple of checks --- qcsrc/server/client.qc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 8156bce18..6dcad909c 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -2650,6 +2650,8 @@ void PlayerPostThink (entity this) { ++totalClients; }); + if (maxclients - totalClients > autocvar_sv_maxidle_slots) + totalClients = 0; } } else if (IS_PLAYER(this) && autocvar_sv_maxidle_playertospectator > 0) @@ -2660,8 +2662,7 @@ void PlayerPostThink (entity this) }); } - if (totalClients <= 1 - || (autocvar_sv_maxidle > 0 && autocvar_sv_maxidle_slots > 0 && (maxclients - totalClients) > autocvar_sv_maxidle_slots)) + if (totalClients <= 1) { CS(this).parm_idlesince = time; /* do nothing */ -- 2.39.2