]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_world.qc
Style: expand LAMBDA()
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_world.qc
index 4ad405adb1908665ab078cf25682297783c0c1bb..f00db073e47e1b805fd1bf5ac90a85cffb2e5a3a 100644 (file)
@@ -1459,7 +1459,7 @@ void DumpStats(float final)
        if(to_file)
                fputs(file, strcat(s, "\n"));
 
-       FOREACH_CLIENT(IS_REAL_CLIENT(it) || (IS_BOT_CLIENT(it) && autocvar_sv_logscores_bots), LAMBDA(
+       FOREACH_CLIENT(IS_REAL_CLIENT(it) || (IS_BOT_CLIENT(it) && autocvar_sv_logscores_bots), {
                s = strcat(":player:see-labels:", GetPlayerScoreString(it, 0), ":");
                s = strcat(s, ftos(rint(time - CS(it).jointime)), ":");
                if(IS_PLAYER(it) || MUTATOR_CALLHOOK(GetPlayerStatus, it))
@@ -1473,7 +1473,7 @@ void DumpStats(float final)
                        GameLogEcho(strcat(s, ftos(it.playerid), ":", playername(it, false)));
                if(to_file)
                        fputs(file, strcat(s, playername(it, false), "\n"));
-       ));
+       });
 
        if(teamplay)
        {
@@ -1530,9 +1530,9 @@ void FixIntermissionClient(entity e)
                {
                        stuffcmd(e, "\nscr_printspeed 1000000\n");
                        RandomSelection_Init();
-                       FOREACH_WORD(autocvar_sv_intermission_cdtrack, true, LAMBDA(
+                       FOREACH_WORD(autocvar_sv_intermission_cdtrack, true, {
                                RandomSelection_AddString(it, 1, 1);
-                       ));
+                       });
                        if (RandomSelection_chosen_string != "")
                        {
                                stuffcmd(e, sprintf("\ncd loop %s\n", RandomSelection_chosen_string));
@@ -1582,11 +1582,11 @@ void NextLevel()
 
        GameLogClose();
 
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it), {
                FixIntermissionClient(it);
                if(it.winning)
                        bprint(playername(it, false), " ^7wins.\n");
-       ));
+       });
 
        target_music_kill();
 
@@ -1660,22 +1660,22 @@ float GetWinningCode(float fraglimitreached, float equality)
 // set the .winning flag for exactly those players with a given field value
 void SetWinners(.float field, float value)
 {
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(it.winning = (it.(field) == value)));
+       FOREACH_CLIENT(IS_PLAYER(it), { it.winning = (it.(field) == value); });
 }
 
 // set the .winning flag for those players with a given field value
 void AddWinners(.float field, float value)
 {
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it), {
                if(it.(field) == value)
                        it.winning = 1;
-       ));
+       });
 }
 
 // clear the .winning flags
 void ClearWinners()
 {
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(it.winning = 0));
+       FOREACH_CLIENT(IS_PLAYER(it), { it.winning = 0; });
 }
 
 void ShuffleMaplist()
@@ -1768,7 +1768,7 @@ float WinningCondition_RanOutOfSpawns()
 
        team1_score = team2_score = team3_score = team4_score = 0;
 
-       FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it), {
                switch(it.team)
                {
                        case NUM_TEAM_1: team1_score = 1; break;
@@ -1776,7 +1776,7 @@ float WinningCondition_RanOutOfSpawns()
                        case NUM_TEAM_3: team3_score = 1; break;
                        case NUM_TEAM_4: team4_score = 1; break;
                }
-       ));
+       });
 
        IL_EACH(g_spawnpoints, true,
        {
@@ -1902,13 +1902,13 @@ void CheckRules_World()
                                float playerswithlaps;
                                float readyplayers;
                                totalplayers = playerswithlaps = readyplayers = 0;
-                               FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+                               FOREACH_CLIENT(IS_PLAYER(it), {
                                        ++totalplayers;
                                        if(PlayerScore_Add(it, SP_RACE_FASTEST, 0))
                                                ++playerswithlaps;
                                        if(it.ready)
                                                ++readyplayers;
-                               ));
+                               });
 
                                // at least 2 of the players have completed a lap: start the RACE
                                // otherwise, the players should end the qualifying on their own
@@ -2128,7 +2128,7 @@ float RedirectionThink()
        redirection_nextthink = time + 1;
 
        clients_found = 0;
-       FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(
+       FOREACH_CLIENT(IS_REAL_CLIENT(it), {
                // TODO add timer
                LOG_INFO("Redirecting: sending connect command to ", it.netname, "\n");
                if(redirection_target == "self")
@@ -2136,7 +2136,7 @@ float RedirectionThink()
                else
                        stuffcmd(it, strcat("\ndisconnect; defer ", ftos(autocvar_quit_and_redirect_timer), " \"connect ", redirection_target, "\"\n"));
                ++clients_found;
-       ));
+       });
 
        LOG_INFO("Redirecting: ", ftos(clients_found), " clients left.\n");