Skip to content

Commit

Permalink
Add late team-name checking if no name set yet.
Browse files Browse the repository at this point in the history
  • Loading branch information
splewis committed Jun 8, 2016
1 parent 94eae39 commit 2be5326
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripting/get5.sp
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,8 @@ public Action Command_Ready(int client, int args) {
}

static void PrintReadyMessage(MatchTeam team) {
CheckTeamNameStatus(team);

if (g_GameState == GameState_PreVeto) {
Get5_MessageToAll("%s is ready to veto.", g_FormattedTeamNames[team]);
} else if (g_GameState == GameState_Warmup) {
Expand Down
20 changes: 20 additions & 0 deletions scripting/get5/matchconfig.sp
Original file line number Diff line number Diff line change
Expand Up @@ -855,4 +855,24 @@ static void AddTeamLogoToDownloadTable(const char[] logoName) {
}
}

public void CheckTeamNameStatus(MatchTeam team) {
if (StrEqual(g_TeamNames[team], "") && team != MatchTeam_TeamSpec) {
for (int i = 1; i <= MaxClients; i++) {
if (IsAuthedPlayer(i)) {
if (GetClientMatchTeam(i) == team) {
char clientName[MAX_NAME_LENGTH];
GetClientName(i, clientName, sizeof(clientName));
Format(g_TeamNames[team], MAX_CVAR_LENGTH, "team_%s", clientName);
break;
}
}
}

char colorTag[32] = TEAM1_COLOR;
if (team == MatchTeam_Team2)
colorTag = TEAM2_COLOR;

Format(g_FormattedTeamNames[team], MAX_CVAR_LENGTH, "%s%s{NORMAL}",
colorTag, g_TeamNames[team]);
}
}

0 comments on commit 2be5326

Please sign in to comment.