fix team balance gsc

This commit is contained in:
m 2024-01-09 17:20:58 -06:00
parent d0110ee58c
commit 24a8c68abf

View File

@ -18,7 +18,7 @@ balance_teams_stub()
{ {
handle_lowest_score_player(allied_players, "axis"); handle_lowest_score_player(allied_players, "axis");
} }
else if (is_team_bigger_than(axis_players, team)) else if (is_team_bigger_than(axis_players, allied_players))
{ {
handle_lowest_score_player(axis_players, "allies"); handle_lowest_score_player(axis_players, "allies");
} }
@ -41,7 +41,7 @@ get_valid_team_array(team)
if (isdefined(players[i].pers["team"]) && players[i].pers["team"] == team) if (isdefined(players[i].pers["team"]) && players[i].pers["team"] == team)
team_array[team_array.size] = players[i]; team_array[team_array.size] = players[i];
} }
return team_arary; return team_array;
} }
is_team_bigger_than(team_one, team_two) is_team_bigger_than(team_one, team_two)
@ -56,13 +56,13 @@ handle_lowest_score_player(team, new_team)
// move the player that has the lowest score (highest teamTime value) // move the player that has the lowest score (highest teamTime value)
for (i = 0; i < team.size; i++) for (i = 0; i < team.size; i++)
{ {
if (isdefined(team[j].dont_auto_balance)) if (isdefined(team[i].dont_auto_balance))
continue; continue;
if (!isdefined(lowest_score_player)) if (!isdefined(lowest_score_player))
lowest_score_player = team[j]; lowest_score_player = team[i];
else if (team[j].pers["score"] < lowest_score_player.pers["score"]) else if (team[i].pers["score"] < lowest_score_player.pers["score"])
lowest_score_player = team[j]; lowest_score_player = team[i];
} }
lowest_score_player set_team(new_team); lowest_score_player set_team(new_team);