]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Avoid repeating a couple of checks
authorterencehill <piuntn@gmail.com>
Tue, 17 Aug 2021 17:00:44 +0000 (19:00 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 17 Aug 2021 17:00:44 +0000 (19:00 +0200)
qcsrc/server/client.qc

index 8156bce181691f6e7490363fb0cbdb2e864716a0..6dcad909c19912ea6756e349dcf356e70d480fe3 100644 (file)
@@ -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 */