Open trayer3 opened 9 years ago
Shouldn't the smallestTeamSize variable be updated to the size of the found team along with the smallestTeamColor?
otherwise if team index of 0 is size 4 and team 1 is size 2 and team 2 is size 3 then team 2 will be seen as the "smallest" because it was smaller than the initially checked team (team 0 ) because it is not resetting the smallest team size when it hits team 1.
teamsBalanced is set to true by default. which is good. But it is only ever set to false if a Smaller team is found. If the first team ( index 0 ) is smaller than all other teams then teamsBalanced will remain true.
Example : Team[0] size = 1 Team[1] size = 2 Team[2] size = 5 Team[3] size =100
in this example teamsbalanced will remain true because the size of every team 1-3 will be greater than the size of team[0].
then it will randomly Pick a team to assign the next player to which has a random 3 out of 4 chance of being a team other than the smallest team (not team 0)
Still seems to not work sometimes. Needs more thorough testing.