Fix team play: correct team indices, team-aware unit colors and ownership
Server: - Add TeamCount, PlayerOneTeamIndex, PlayerTwoTeamIndex to GameSession so team assignments survive the lobby→game transition without recomputation - GameLobbyReadyHandler.StartGameAsync: apply TeamAssignmentsJson (host custom reassignments) for all seats; store P1/P2 team indices on the session - GameReadyHandler N-player path: use session.PlayerOneTeamIndex / PlayerTwoTeamIndex instead of hardcoded teamCount=1 (which put both P1 and P2 on team 0 in every non-FFA game) - EF migration: AddGameSessionTeamFields Client (game_screen.gd): - _rebuild_ownership: treat same-team allies as friendly instead of enemy - Unit color loop: use state.teamColors palette per team instead of hardcoded blue (self) / red (everyone else) - _on_game_over: derive i_won from player_outcomes[me].outcome == "Winner" so a teammate's final kill correctly shows "Victory!" for the whole team Also: skip absent hex tiles in BoardTemplateBuilder SVG render Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -297,6 +297,9 @@ else
|
||||
@for (int col = 0; col < hexDim; col++)
|
||||
{
|
||||
if (!IsHexInBounds(col, row, hexN)) continue;
|
||||
// Absent tiles are outside the polygon shape — don't render them.
|
||||
// (CSS repeating-linear-gradient is not a valid SVG fill value.)
|
||||
if (_tiles.TryGetValue(TileKey(col, row), out var svgTd) && svgTd.IsAbsent) continue;
|
||||
var hr = row; var hc = col;
|
||||
double cx = HexCellX(hc, hr, hexN, HexR, HexPad);
|
||||
double cy = HexCellY(hr, hexN, HexR, HexPad);
|
||||
|
||||
Reference in New Issue
Block a user