Skip to content

Commit

Permalink
fix case, when one player was listed as captain on both teams
Browse files Browse the repository at this point in the history
  • Loading branch information
TerminalHash committed Apr 21, 2024
1 parent 72c7379 commit 27b87a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Modules/CaptainsModule/Commands/PickingCommands.as
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ class AppointCommand : ChatCommand
return;
}

// if admin accidentally wrote the same player's name twice
if (blue_leader.getUsername() == red_leader.getUsername() || red_leader.getUsername() == blue_leader.getUsername())
{
error("One player cannot be a leader in two teams at the same time!");
return;
}

rules.set_string("team_0_leader", blue_leader.getUsername());
rules.set_string("team_1_leader", red_leader.getUsername());

Expand Down
3 changes: 0 additions & 3 deletions Rules/CommonScripts/ChatCommands.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ commands =
togglechclass; 1; 0;
bindings; 0; 0;
mutevoice; 1; 0;
#mutetags; 0; 0;
#unmutetags; 0; 0;
togglesounds; 0; 0;
#sharks; 0; 1;
#bisons; 0; 1;

Expand Down

0 comments on commit 27b87a6

Please sign in to comment.