Repository navigation
Conversation
Players were seated one at a time in join order. In Duos/Trios/Quads the tie-break packs the fullest open team, so the first friend took the last seat beside a stranger and the second friend found that team full. Friend groups are now seated back to back, largest first, and the first member goes to a team with room for the whole group when there is one. Groups too big for one team still spill over rather than kicking anyone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughTeam assignment now groups connected friends and processes larger groups first. Team selection considers how many remaining group members fit on each team. Tests cover duo and three-person friend groups. ChangesFriend-group placement
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix Possibly related PRs
Suggested reviewers: Merge Risk: ⚪ Minimal · up to
|
🤖 Claude Code ReviewVerdict: No issues found. 0 findings (0 high, 0 medium, 0 low). Checked for bugs and CLAUDE.md compliance. Notes from the review:
|
🤖 Claude Code ReviewReviewed range: Verdict: No issues found. 0 findings (0 high, 0 medium, 0 low). This range only merges in the base branch. It doesn't touch this PR's own files ( |
What was wrong
A player reported (support ticket #3877) that they and a friend joined the same public Duos lobby before it started, but were put on different teams.
In public team games, players who aren't in a clan were seated one at a time, in the order they joined. Each player went to the team with the most of their friends on it. If no team had any, Duos, Trios and Quads put them on the fullest team that still had room.
That breaks when a friend group is split by strangers in the join order:
The existing tests didn't catch this because the friends were always the first players in the list.
What this changes
All in
packages/engine-lib/src/game/TeamAssignment.ts:Clan grouping, matchmade team pins (ranked 2v2/FFA, clan wars) and nation placement aren't changed. The lobby preview uses the same function, so the teams it shows stay in step with the game.
Example (3 Duos teams, 6 players)
s1 Red, A Red, B Blue❌A Red, B Red, s1 Blue✅A Red, s1 Red, s2 Blue, B Blue❌A Red, B Red, s1 Blue, s2 Blue✅Screenshots
None: this changes team assignment in the simulation, not any UI. The examples above are the real output of
assignTeams.Things to know
/users/@me).Tests
Three new regression tests in
tests/TeamAssignment.test.ts. All three fail onmainand pass with this change:npx vitest tests/TeamAssignment.test.ts --run: 34/34 pass. The full suite's only failures (RenderDesktopDescriptor,UpdateRegister) also fail on an unmodified checkout on Windows and aren't related. Lint and typecheck are clean.🤖 Generated with Claude Code