Skip to content

Commit

Permalink
Merge pull request splewis#855 from PhlexPlexico/test-fix
Browse files Browse the repository at this point in the history
Udpate Command_Test to ensure it does not fail.
  • Loading branch information
PhlexPlexico authored Aug 23, 2022
2 parents 1130b66 + e6b7b80 commit f3327c9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
24 changes: 12 additions & 12 deletions scripting/get5.sp
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,12 @@ public void OnPluginStart() {
g_KickClientsWithNoMatchCvar =
CreateConVar("get5_kick_when_no_match_loaded", "0",
"Whether the plugin kicks new clients when no match is loaded");
g_LiveCfgCvar = CreateConVar("get5_live_cfg", "get5/live.cfg", "Config file to exec when the game goes live.");
g_WarmupCfgCvar = CreateConVar("get5_warmup_cfg", "get5/warmup.cfg", "Config file to exec in warmup periods.");
g_KnifeCfgCvar = CreateConVar("get5_knife_cfg", "get5/knife.cfg", "Config file to exec in knife periods.");
g_LiveCfgCvar = CreateConVar("get5_live_cfg", "get5/live.cfg",
"Config file to exec when the game goes live.");
g_WarmupCfgCvar =
CreateConVar("get5_warmup_cfg", "get5/warmup.cfg", "Config file to exec in warmup periods.");
g_KnifeCfgCvar =
CreateConVar("get5_knife_cfg", "get5/knife.cfg", "Config file to exec in knife periods.");
g_LiveCountdownTimeCvar = CreateConVar(
"get5_live_countdown_time", "10",
"Number of seconds used to count down when a match is going live", 0, true, 5.0, true, 60.0);
Expand Down Expand Up @@ -439,15 +442,12 @@ public void OnPluginStart() {
g_PhaseAnnouncementCountCvar = CreateConVar(
"get5_phase_announcement_count", "5",
"The number of times Get5 will print 'Knife' or 'Match is LIVE' when the game starts. Set to 0 to disable.");
g_Team1NameColorCvar = CreateConVar(
"get5_team1_color", "{LIGHT_GREEN}",
"The color used for the name of team 1 in chat messages.");
g_Team2NameColorCvar = CreateConVar(
"get5_team2_color", "{PINK}",
"The color used for the name of team 2 in chat messages.");
g_SpecNameColorCvar = CreateConVar(
"get5_spec_color", "{NORMAL}",
"The color used for the name of spectators in chat messages.");
g_Team1NameColorCvar = CreateConVar("get5_team1_color", "{LIGHT_GREEN}",
"The color used for the name of team 1 in chat messages.");
g_Team2NameColorCvar = CreateConVar("get5_team2_color", "{PINK}",
"The color used for the name of team 2 in chat messages.");
g_SpecNameColorCvar = CreateConVar("get5_spec_color", "{NORMAL}",
"The color used for the name of spectators in chat messages.");

/** Create and exec plugin's configuration file **/
AutoExecConfig(true, "get5");
Expand Down
3 changes: 2 additions & 1 deletion scripting/get5/matchconfig.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,8 @@ public Action Command_CreateMatch(int client, int args) {
char teamName[MAX_CVAR_LENGTH];

// If team names are empty because nobody is on on the server, the will be set by
// CheckTeamNameStatus during ready-phase. We cannot write empty strings to KeyValues, so we just skip them.
// CheckTeamNameStatus during ready-phase. We cannot write empty strings to KeyValues, so we just
// skip them.
kv.JumpToKey("team1", true);
if (AddPlayersToAuthKv(kv, Get5Team_1, teamName) > 0) {
kv.SetString("name", teamName);
Expand Down
3 changes: 2 additions & 1 deletion scripting/get5/tests.sp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public void Get5_Test() {
KV_Test();

g_GameState = Get5State_None;
LogMessage("Tests complete!");
}

static void Utils_Test() {
Expand Down Expand Up @@ -72,7 +73,7 @@ static void KV_Test() {
AssertEq("maps_to_win", g_MapsToWin, 2);
AssertEq("bo2_series", g_BO2Match, false);
AssertEq("skip_veto", g_SkipVeto, false);
AssertEq("players_per_team", g_PlayersPerTeam, 1);
AssertEq("players_per_team", g_PlayersPerTeam, 5);
AssertEq("favored_percentage_team1", g_FavoredTeamPercentage, 65);

AssertTrue("team1.name", StrEqual(g_TeamNames[Get5Team_1], "EnvyUs", false));
Expand Down

0 comments on commit f3327c9

Please sign in to comment.