Fix tablist column calculation breaking #1473
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current logic could break in some scenarios, like a map having 9,1,9 players, means each of the big teams wants "1.8" columns, meaning they each get rounded to 2, plus the small team, makes a total of 5 columns.
I've ditched the logic of each team trying to figure out its size, instead the teams looking at all the other teams in the same row to make the decision.
For 2-team splits, one has to be significantly larger than the other for a 3/1 split, otherwise 2/2 split
For 3-team splits, one has to be bigger than the other two for a 2/1/1 split, otherwise 1/1/1 split (one empty column)
All other cases are trivial (1 team is 4 columns, 4 teams is 1/1/1/1).
Also fixes a long-time nit of mine, if a map has 6 teams before it would split like 1/1/1/1 first row, and 2nd row 1/1 leaving 2 unused columns. Now it would instead do 2/2 in the second row split, as teams look at all the other teams in the same row, instead of overall.
Eg:

(in this image, it is assumed that there would be enough obs to fill till that row)