]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/sv_cmd.qc
Reclaim the `new` keyword for entity classes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / sv_cmd.qc
index 718c0e5600a9a282c09b8b7f4cf14e6e1cd456ab..d4489106dac8d8bd71c151efc841ed9679cc9d9b 100644 (file)
@@ -46,7 +46,7 @@ void make_mapinfo_Think()
 void changematchtime(float delta, float mi, float ma)
 {
        float cur;
-       float new;
+       float update;
        float lim;
 
        if(delta == 0)
@@ -67,21 +67,21 @@ void changematchtime(float delta, float mi, float ma)
                if(lim == 0)
                        return; // cannot increase any further
                else if(lim < ma)
-                       new = min(ma, lim + delta);
+                       update = min(ma, lim + delta);
                else // already above maximum: FAIL
                        return;
        }
        else
        {
                if(lim == 0) // infinite: try reducing to max, if we are allowed to
-                       new = max(mi, ma);
+                       update = max(mi, ma);
                else if(lim > mi) // above minimum: decrease
-                       new = max(mi, lim + delta);
+                       update = max(mi, lim + delta);
                else // already below minimum: FAIL
                        return;
        }
 
-       cvar_set("timelimit", ftos(new / 60));
+       cvar_set("timelimit", ftos(update / 60));
 }
 
 
@@ -108,7 +108,7 @@ void GameCommand_adminmsg(float request, float argc)
 
                        if((targets) && (admin_message))
                        {
-                               for(0;targets;)
+                               for (;targets;)
                                {
                                        t = car(targets); targets = cdr(targets);
 
@@ -504,7 +504,7 @@ void GameCommand_cointoss(float request, float argc)
                        string result1 = (argv(2) ? strcat("^7", argv(1)) : "^1HEADS");
                        string result2 = (argv(2) ? strcat("^7", argv(2)) : "^4TAILS");
                        string choice = ((random() > 0.5) ? result1 : result2);
-                       
+
                        Send_Notification(NOTIF_ALL, world, MSG_MULTI, MULTI_COINTOSS, choice);
                        return;
                }
@@ -1047,7 +1047,7 @@ void GameCommand_moveplayer(float request, float argc)
                        // lets see if the target(s) even actually exist.
                        if((targets) && (destination))
                        {
-                               for(0;targets;)
+                               for (;targets;)
                                {
                                        t = car(targets); targets = cdr(targets);
 
@@ -1379,7 +1379,8 @@ void GameCommand_shuffleteams(float request)
                        if(teamplay)
                        {
                                entity tmp_player;
-                               float i, x, z, t_teams, t_players, team_color;
+                               int i;
+                               float x, t_teams, t_players, team_color;
 
                                // count the total amount of players and total amount of teams
                                t_players = 0;
@@ -1399,7 +1400,7 @@ void GameCommand_shuffleteams(float request)
                                // build a list of the players in a random order
                                FOR_EACH_PLAYER(tmp_player)
                                {
-                                       for(0;;)
+                                       for (;;)
                                        {
                                                i = bound(1, floor(random() * maxclients) + 1, maxclients);
 
@@ -1416,7 +1417,7 @@ void GameCommand_shuffleteams(float request)
                                }
 
                                // finally, from the list made earlier, re-join the players in different order.
-                               for(i = 1; i <= t_teams; ++i)
+                               for (int i = 1; i <= t_teams; ++i)
                                {
                                        // find out how many players to assign to this team
                                        x = (t_players / t_teams);
@@ -1425,7 +1426,7 @@ void GameCommand_shuffleteams(float request)
                                        team_color = Team_NumberToTeam(i);
 
                                        // sort through the random list of players made earlier
-                                       for(z = 1; z <= maxclients; ++z)
+                                       for (int z = 1; z <= maxclients; ++z)
                                        {
                                                if (!(shuffleteams_teams[i] >= x))
                                                {
@@ -1541,7 +1542,7 @@ void GameCommand_trace(float request, float argc)
                                        float hitcount = 0;
                                        print("TEST CASE. If this returns the runaway loop counter error, possibly everything is oaky.\n");
                                        float worst_endpos_bug = 0;
-                                       for(0;;)
+                                       for (;;)
                                        {
                                                org = world.mins;
                                                delta = world.maxs - world.mins;
@@ -1570,7 +1571,7 @@ void GameCommand_trace(float request, float argc)
                                                                // how much do we need to back off?
                                                                safe = 1;
                                                                unsafe = 0;
-                                                               for(0;;)
+                                                               for (;;)
                                                                {
                                                                        pos = p * (1 - (safe + unsafe) * 0.5) + start * ((safe + unsafe) * 0.5);
                                                                        tracebox(pos, PL_MIN, PL_MAX, pos, MOVE_NOMONSTERS, world);
@@ -1604,7 +1605,7 @@ void GameCommand_trace(float request, float argc)
                                                                q0 = p;
                                                                dq = 0;
                                                                dqf = 1;
-                                                               for(0;;)
+                                                               for (;;)
                                                                {
                                                                        q = p + normalize(end - p) * (dq + dqf);
                                                                        if(q == q0)