Skip to content

Commit

Permalink
Fix: add player to team after all relevant teams have been sent to th…
Browse files Browse the repository at this point in the history
…at client
  • Loading branch information
Gegy committed Jun 9, 2024
1 parent b6f9246 commit 2cbca9a
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,16 @@ private TeamManager.State teamState(GameTeamKey team) {
}

private void onAddPlayer(ServerPlayerEntity player) {
this.sendTeamsToPlayer(player);
this.restoreFormerTeams(player);
}

private void restoreFormerTeams(ServerPlayerEntity player) {
var team = this.teamFor(player);
if (team != null) {
var state = this.teamState(team);
this.addOnlinePlayer(player, state);
}

this.sendTeamsToPlayer(player);
}

private void onRemovePlayer(ServerPlayerEntity player) {
Expand Down

0 comments on commit 2cbca9a

Please sign in to comment.