]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/sv_main.qc
Loops
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / sv_main.qc
index 2433dc163d7275fdf85cbc3d47f56dc756ab1293..3ecd4714b17589ce71fd1aec580246faba1a071f 100644 (file)
@@ -127,12 +127,10 @@ void CreatureFrame_All()
 void Pause_TryPause(bool ispaused)
 {
        int n = 0;
-       entity it;
-       FOR_EACH_REALPLAYER(it)
-       {
+       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), LAMBDA(
                if (PHYS_INPUT_BUTTON_CHAT(it) != ispaused) return;
                ++n;
-       }
+       ));
        if (!n) return;
        setpause(ispaused);
 }
@@ -173,14 +171,12 @@ void StartFrame()
                LOG_INFO("CEFC time: ", ftos(t * 1000), "ms; ");
                int c_seeing = 0;
                int c_seen = 0;
-               entity cl;
-               FOR_EACH_CLIENT(cl)
-               {
-                       if(IS_REAL_CLIENT(cl))
+               FOREACH_CLIENT(true, LAMBDA(
+                       if(IS_REAL_CLIENT(it))
                                ++c_seeing;
-                       if(IS_PLAYER(cl))
+                       if(IS_PLAYER(it))
                                ++c_seen;
-               }
+               ));
                LOG_INFO("CEFC calls per second: ", ftos(c_seeing * (c_seen - 1) / t), "; ");
                LOG_INFO("CEFC 100% load at: ", ftos(solve_quadratic(t, -t, -1) * '0 1 0'), "\n");