From: terencehill Date: Tue, 17 Aug 2021 17:00:44 +0000 (+0200) Subject: Avoid repeating a couple of checks X-Git-Tag: xonotic-v0.8.5~353^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=138941d929cd431b69ffc3ef14fcf6e0d3af4285;p=xonotic%2Fxonotic-data.pk3dir.git Avoid repeating a couple of checks --- 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 */