]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Renamed lowestplayerteamX to lowesthumanteamX.
authorLyberta <lyberta@lyberta.net>
Wed, 2 Aug 2017 03:54:10 +0000 (06:54 +0300)
committerLyberta <lyberta@lyberta.net>
Wed, 2 Aug 2017 03:54:10 +0000 (06:54 +0300)
qcsrc/server/mutators/events.qh
qcsrc/server/teamplay.qc
qcsrc/server/teamplay.qh

index 6522c46b32b0a55cd0c4c94e9b2f2d6ebb346a0f..ec5d3f1ecdeceb65f25c41460800ac3616f49ed5 100644 (file)
@@ -141,7 +141,7 @@ MUTATOR_HOOKABLE(GetTeamCounts, EV_NO_ARGS);
     /**/                                   o(float, MUTATOR_ARGV_2_float) \
     /** number of bots in a team        */ i(float, MUTATOR_ARGV_3_float) \
     /**/                                   o(float, MUTATOR_ARGV_3_float) \
-    /** lowest scoring player in a team */ i(entity, MUTATOR_ARGV_4_entity) \
+    /** lowest scoring human in a team  */ i(entity, MUTATOR_ARGV_4_entity) \
     /**/                                   o(entity, MUTATOR_ARGV_4_entity) \
     /** lowest scoring bot in a team    */ i(entity, MUTATOR_ARGV_5_entity) \
     /**/                                   o(entity, MUTATOR_ARGV_5_entity) \
index 61e2690c85c57359d2f5270864e92356b03e76e2..da53e57e54d4a335a7f325964c3ab36ad0570f1a 100644 (file)
@@ -333,37 +333,37 @@ void GetTeamCounts(entity ignore)
                if (c1 >= 0)
                {
                        MUTATOR_CALLHOOK(GetTeamCount, NUM_TEAM_1, ignore, c1, numbotsteam1,
-                               lowestplayerteam1, lowestbotteam1);
+                               lowesthumanteam1, lowestbotteam1);
                        c1 = M_ARGV(2, float);
                        numbotsteam1 = M_ARGV(3, float);
-                       lowestplayerteam1 = M_ARGV(4, entity);
+                       lowesthumanteam1 = M_ARGV(4, entity);
                        lowestbotteam1 = M_ARGV(5, entity);
                }
                if (c2 >= 0)
                {
                        MUTATOR_CALLHOOK(GetTeamCount, NUM_TEAM_2, ignore, c2, numbotsteam2,
-                               lowestplayerteam2, lowestbotteam2);
+                               lowesthumanteam2, lowestbotteam2);
                        c2 = M_ARGV(2, float);
                        numbotsteam2 = M_ARGV(3, float);
-                       lowestplayerteam2 = M_ARGV(4, entity);
+                       lowesthumanteam2 = M_ARGV(4, entity);
                        lowestbotteam2 = M_ARGV(5, entity);
                }
                if (c3 >= 0)
                {
                        MUTATOR_CALLHOOK(GetTeamCount, NUM_TEAM_3, ignore, c3, numbotsteam3,
-                               lowestplayerteam3, lowestbotteam3);
+                               lowesthumanteam3, lowestbotteam3);
                        c3 = M_ARGV(2, float);
                        numbotsteam3 = M_ARGV(3, float);
-                       lowestplayerteam3 = M_ARGV(4, entity);
+                       lowesthumanteam3 = M_ARGV(4, entity);
                        lowestbotteam3 = M_ARGV(5, entity);
                }
                if (c4 >= 0)
                {
                        MUTATOR_CALLHOOK(GetTeamCount, NUM_TEAM_4, ignore, c4, numbotsteam4,
-                               lowestplayerteam4, lowestbotteam4);
+                               lowesthumanteam4, lowestbotteam4);
                        c4 = M_ARGV(2, float);
                        numbotsteam4 = M_ARGV(3, float);
-                       lowestplayerteam4 = M_ARGV(4, entity);
+                       lowesthumanteam4 = M_ARGV(4, entity);
                        lowestbotteam4 = M_ARGV(5, entity);
                }
        }
@@ -371,15 +371,16 @@ void GetTeamCounts(entity ignore)
        {
                float value, bvalue;
                // now count how many players are on each team already
-               float lowestplayerscore1 = FLOAT_MAX;
+               float lowesthumanscore1 = FLOAT_MAX;
                float lowestbotscore1 = FLOAT_MAX;
-               float lowestplayerscore2 = FLOAT_MAX;
+               float lowesthumanscore2 = FLOAT_MAX;
                float lowestbotscore2 = FLOAT_MAX;
-               float lowestplayerscore3 = FLOAT_MAX;
+               float lowesthumanscore3 = FLOAT_MAX;
                float lowestbotscore3 = FLOAT_MAX;
-               float lowestplayerscore4 = FLOAT_MAX;
+               float lowesthumanscore4 = FLOAT_MAX;
                float lowestbotscore4 = FLOAT_MAX;
-               FOREACH_CLIENT(true, LAMBDA(
+               FOREACH_CLIENT(true,
+               {
                        float t;
                        if (IS_PLAYER(it) || it.caplayer)
                        {
@@ -423,10 +424,10 @@ void GetTeamCounts(entity ignore)
                                        float tempscore = PlayerScore_Get(it, SP_SCORE);
                                        if (!bvalue)
                                        {
-                                               if (tempscore < lowestplayerscore1)
+                                               if (tempscore < lowesthumanscore1)
                                                {
-                                                       lowestplayerteam1 = it;
-                                                       lowestplayerscore1 = tempscore;
+                                                       lowesthumanteam1 = it;
+                                                       lowesthumanscore1 = tempscore;
                                                }
                                                break;
                                        }
@@ -448,10 +449,10 @@ void GetTeamCounts(entity ignore)
                                        float tempscore = PlayerScore_Get(it, SP_SCORE);
                                        if (!bvalue)
                                        {
-                                               if (tempscore < lowestplayerscore2)
+                                               if (tempscore < lowesthumanscore2)
                                                {
-                                                       lowestplayerteam2 = it;
-                                                       lowestplayerscore2 = tempscore;
+                                                       lowesthumanteam2 = it;
+                                                       lowesthumanscore2 = tempscore;
                                                }
                                                break;
                                        }
@@ -473,10 +474,10 @@ void GetTeamCounts(entity ignore)
                                        float tempscore = PlayerScore_Get(it, SP_SCORE);
                                        if (!bvalue)
                                        {
-                                               if (tempscore < lowestplayerscore3)
+                                               if (tempscore < lowesthumanscore3)
                                                {
-                                                       lowestplayerteam3 = it;
-                                                       lowestplayerscore3 = tempscore;
+                                                       lowesthumanteam3 = it;
+                                                       lowesthumanscore3 = tempscore;
                                                }
                                                break;
                                        }
@@ -498,10 +499,10 @@ void GetTeamCounts(entity ignore)
                                        float tempscore = PlayerScore_Get(it, SP_SCORE);
                                        if (!bvalue)
                                        {
-                                               if (tempscore < lowestplayerscore4)
+                                               if (tempscore < lowesthumanscore4)
                                                {
-                                                       lowestplayerteam4 = it;
-                                                       lowestplayerscore4 = tempscore;
+                                                       lowesthumanteam4 = it;
+                                                       lowesthumanscore4 = tempscore;
                                                }
                                                break;
                                        }
@@ -513,7 +514,7 @@ void GetTeamCounts(entity ignore)
                                        break;
                                }
                        }
-               ));
+               });
        }
 
        // if the player who has a forced team has not joined yet, reserve the spot
index 5d1130d5e6a8c3a3ffdc078776d549671da30279..44f54fa91a03a163f54a167b8a24c42a91f676c0 100644 (file)
@@ -5,19 +5,22 @@ string cache_lastmutatormsg;
 
 // client counts for each team
 //float c1, c2, c3, c4;
-// # of bots on those teams
-float numbotsteam1;
-float numbotsteam2;
-float numbotsteam3;
-float numbotsteam4;
-entity lowestplayerteam1;
-entity lowestplayerteam2;
-entity lowestplayerteam3;
-entity lowestplayerteam4;
-entity lowestbotteam1;
-entity lowestbotteam2;
-entity lowestbotteam3;
-entity lowestbotteam4;
+
+// The following variables are used for balancing. They are not updated
+// automatically. You need to call CheckAllowedTeams and GetTeamCounts to get
+// proper values.
+float numbotsteam1; ///< Number of bots in the first team.
+float numbotsteam2; ///< Number of bots in the second team.
+float numbotsteam3; ///< Number of bots in the third team.
+float numbotsteam4; ///< Number of bots in the fourth team.
+entity lowesthumanteam1; ///< Human with the lowest score in the first team.
+entity lowesthumanteam2; ///< Human with the lowest score in the second team.
+entity lowesthumanteam3; ///< Human with the lowest score in the third team.
+entity lowesthumanteam4; ///< Human with the lowest score in the fourth team.
+entity lowestbotteam1; ///< Bot with the lowest score in the first team.
+entity lowestbotteam2; ///< Bot with the lowest score in the second team.
+entity lowestbotteam3; ///< Bot with the lowest score in the third team.
+entity lowestbotteam4; ///< Bot with the lowest score in the fourth team.
 
 int redowned, blueowned, yellowowned, pinkowned;