+ MUTATOR_CALLHOOK(GetTeamCount, NUM_TEAM_1, ignore, c1,
+ num_bots_team1, lowest_human_team1, lowest_bot_team1);
+ c1 = M_ARGV(2, float);
+ num_bots_team1 = M_ARGV(3, float);
+ lowest_human_team1 = M_ARGV(4, entity);
+ lowest_bot_team1 = M_ARGV(5, entity);
+ }
+ if (c2 >= 0)
+ {
+ MUTATOR_CALLHOOK(GetTeamCount, NUM_TEAM_2, ignore, c2,
+ num_bots_team2, lowest_human_team2, lowest_bot_team2);
+ c2 = M_ARGV(2, float);
+ num_bots_team2 = M_ARGV(3, float);
+ lowest_human_team2 = M_ARGV(4, entity);
+ lowest_bot_team2 = M_ARGV(5, entity);
+ }
+ if (c3 >= 0)
+ {
+ MUTATOR_CALLHOOK(GetTeamCount, NUM_TEAM_3, ignore, c3,
+ num_bots_team3, lowest_human_team3, lowest_bot_team3);
+ c3 = M_ARGV(2, float);
+ num_bots_team3 = M_ARGV(3, float);
+ lowest_human_team3 = M_ARGV(4, entity);
+ lowest_bot_team3 = M_ARGV(5, entity);
+ }
+ if (c4 >= 0)
+ {
+ MUTATOR_CALLHOOK(GetTeamCount, NUM_TEAM_4, ignore,
+ c4, num_bots_team4, lowest_human_team4, lowest_bot_team4);
+ c4 = M_ARGV(2, float);
+ num_bots_team4 = M_ARGV(3, float);
+ lowest_human_team4 = M_ARGV(4, entity);
+ lowest_bot_team4 = M_ARGV(5, entity);
+ }
+ }
+ else
+ {
+ float value, bvalue;
+ // now count how many players are on each team already
+ float lowest_human_score1 = FLOAT_MAX;
+ float lowest_bot_score1 = FLOAT_MAX;
+ float lowest_human_score2 = FLOAT_MAX;
+ float lowest_bot_score2 = FLOAT_MAX;
+ float lowest_human_score3 = FLOAT_MAX;
+ float lowest_bot_score3 = FLOAT_MAX;
+ float lowest_human_score4 = FLOAT_MAX;
+ float lowest_bot_score4 = FLOAT_MAX;
+ FOREACH_CLIENT(true,
+ {
+ float t;
+ if (IS_PLAYER(it) || it.caplayer)
+ {
+ t = it.team;
+ }
+ else if (it.team_forced > 0)
+ {
+ t = it.team_forced; // reserve the spot
+ }
+ else
+ {
+ continue;
+ }
+ if (it == ignore)
+ {
+ continue;
+ }