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);
}
}
{
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)
{
float tempscore = PlayerScore_Get(it, SP_SCORE);
if (!bvalue)
{
- if (tempscore < lowestplayerscore1)
+ if (tempscore < lowesthumanscore1)
{
- lowestplayerteam1 = it;
- lowestplayerscore1 = tempscore;
+ lowesthumanteam1 = it;
+ lowesthumanscore1 = tempscore;
}
break;
}
float tempscore = PlayerScore_Get(it, SP_SCORE);
if (!bvalue)
{
- if (tempscore < lowestplayerscore2)
+ if (tempscore < lowesthumanscore2)
{
- lowestplayerteam2 = it;
- lowestplayerscore2 = tempscore;
+ lowesthumanteam2 = it;
+ lowesthumanscore2 = tempscore;
}
break;
}
float tempscore = PlayerScore_Get(it, SP_SCORE);
if (!bvalue)
{
- if (tempscore < lowestplayerscore3)
+ if (tempscore < lowesthumanscore3)
{
- lowestplayerteam3 = it;
- lowestplayerscore3 = tempscore;
+ lowesthumanteam3 = it;
+ lowesthumanscore3 = tempscore;
}
break;
}
float tempscore = PlayerScore_Get(it, SP_SCORE);
if (!bvalue)
{
- if (tempscore < lowestplayerscore4)
+ if (tempscore < lowesthumanscore4)
{
- lowestplayerteam4 = it;
- lowestplayerscore4 = tempscore;
+ lowesthumanteam4 = it;
+ lowesthumanscore4 = tempscore;
}
break;
}
break;
}
}
- ));
+ });
}
// if the player who has a forced team has not joined yet, reserve the spot
// 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;