Skip to content

Commit

Permalink
Begin calling map/series end forwards on .endmatch.
Browse files Browse the repository at this point in the history
  • Loading branch information
splewis committed Jan 22, 2017
1 parent fc450e1 commit 5629eee
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions scripting/get5.sp
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,29 @@ public Action Command_EndMatch(int client, int args) {
if (g_GameState == GameState_None) {
return Plugin_Handled;
}

// Call game-ending forwards.
char mapName[PLATFORM_MAX_PATH];
GetCleanMapName(mapName, sizeof(mapName));
Call_StartForward(g_OnMapResult);
Call_PushString(mapName);
Call_PushCell(MatchTeam_TeamNone);
Call_PushCell(CS_GetTeamScore(MatchTeamToCSTeam(MatchTeam_Team1)));
Call_PushCell(CS_GetTeamScore(MatchTeamToCSTeam(MatchTeam_Team2)));
Call_PushCell(GetMapNumber() - 1);
Call_Finish();

Call_StartForward(g_OnSeriesResult);
Call_PushCell(MatchTeam_TeamNone);
Call_PushCell(g_TeamSeriesScores[MatchTeam_Team1]);
Call_PushCell(g_TeamSeriesScores[MatchTeam_Team2]);
Call_Finish();

ChangeState(GameState_None);

Get5_MessageToAll("%t", "AdminForceEndInfoMessage");
RestoreCvars(g_MatchConfigChangedCvars);
StopRecording();

return Plugin_Handled;
}
Expand Down

0 comments on commit 5629eee

Please sign in to comment.