]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/vote.qc
Style: expand LAMBDA()
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / vote.qc
index 5f96334ddfd3141ff0208fbd6bb343f5f2e6724d..2db503ca285cf7b0426cd160152d17bc913908c5 100644 (file)
@@ -119,7 +119,7 @@ string OriginalCallerName()
 
 void VoteReset()
 {
-       FOREACH_CLIENT(true, LAMBDA(it.vote_selection = 0));
+       FOREACH_CLIENT(true, { it.vote_selection = 0; });
 
        if (vote_called)
        {
@@ -214,7 +214,7 @@ void VoteCount(float first_count)
        Nagger_VoteCountChanged();
 
        // add up all the votes from each connected client
-       FOREACH_CLIENT(IS_REAL_CLIENT(it) && IS_CLIENT(it), LAMBDA(
+       FOREACH_CLIENT(IS_REAL_CLIENT(it) && IS_CLIENT(it), {
                ++vote_player_count;
                if (IS_PLAYER(it))   ++vote_real_player_count;
                switch (it.vote_selection)
@@ -233,7 +233,7 @@ void VoteCount(float first_count)
                        }
                        default: break;
                }
-       ));
+       });
 
        // Check to see if there are enough players on the server to allow master voting... otherwise, vote master could be used for evil.
        if ((vote_called == VOTE_MASTER) && autocvar_sv_vote_master_playerlimit > vote_player_count)
@@ -362,7 +362,7 @@ void reset_map(bool dorespawn)
                if (it.reset2) it.reset2(it);
        });
 
-       FOREACH_CLIENT(IS_PLAYER(it) && STAT(FROZEN, it), LAMBDA(Unfreeze(it)));
+       FOREACH_CLIENT(IS_PLAYER(it) && STAT(FROZEN, it), { Unfreeze(it); });
 
        // Moving the player reset code here since the player-reset depends
        // on spawnpoint entities which have to be reset first --blub
@@ -422,11 +422,11 @@ void ReadyRestart_force()
        game_starttime = time + RESTART_COUNTDOWN;
 
        // clear player attributes
-       FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+       FOREACH_CLIENT(IS_PLAYER(it), {
                it.alivetime = 0;
                CS(it).killcount = 0;
                PS_GR_P_ADDVAL(it, PLAYERSTATS_ALIVETIME, -PS_GR_P_ADDVAL(it, PLAYERSTATS_ALIVETIME, 0));
-       ));
+       });
 
        restart_mapalreadyrestarted = false; // reset this var, needed when cvar sv_ready_restart_repeatable is in use
 
@@ -434,7 +434,7 @@ void ReadyRestart_force()
        warmup_stage = 0;                // once the game is restarted the game is in match stage
 
        // reset the .ready status of all players (also spectators)
-       FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(it.ready = false));
+       FOREACH_CLIENT(IS_REAL_CLIENT(it), { it.ready = false; });
        readycount = 0;
        Nagger_ReadyCounted();  // NOTE: this causes a resend of that entity, and will also turn off warmup state on the client
 
@@ -456,7 +456,7 @@ void ReadyRestart_force()
        // after a restart every players number of allowed timeouts gets reset, too
        if (autocvar_sv_timeout)
        {
-               FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), LAMBDA(CS(it).allowed_timeouts = autocvar_sv_timeout_number));
+               FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), { CS(it).allowed_timeouts = autocvar_sv_timeout_number; });
        }
     // reset map immediately if this cvar is not set
     if (!autocvar_sv_ready_restart_after_countdown) reset_map(true);
@@ -480,10 +480,10 @@ void ReadyCount()
        float ready_needed_factor, ready_needed_count;
        float t_ready = 0, t_players = 0;
 
-       FOREACH_CLIENT(IS_REAL_CLIENT(it) && (IS_PLAYER(it) || it.caplayer == 1), LAMBDA(
+       FOREACH_CLIENT(IS_REAL_CLIENT(it) && (IS_PLAYER(it) || it.caplayer == 1), {
                ++t_players;
                if (it.ready) ++t_ready;
-       ));
+       });
 
        readycount = t_ready;
 
@@ -808,7 +808,7 @@ void VoteCommand_call(float request, entity caller, float argc, string vote_comm
                                        msg_entity = caller;
                                }
 
-                               FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(++tmp_playercount));
+                               FOREACH_CLIENT(IS_REAL_CLIENT(it), { ++tmp_playercount; });
                                if (tmp_playercount > 1)   Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_VOTE_CALL);  // don't announce a "vote now" sound if player is alone
 
                                bprint("\{1}^2* ^3", OriginalCallerName(), "^2 calls a vote for ", vote_called_display, "\n");