Skip to content

Commit

Permalink
Set mp_team_timeout_max synchronously to prevent incorrect UI momenta…
Browse files Browse the repository at this point in the history
…rily (#1001)
  • Loading branch information
nickdnk committed Mar 20, 2023
1 parent fc435cd commit 12ed9f7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripting/get5/pausing.sp
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,13 @@ Action Command_Pause(int client, int args) {
return Plugin_Handled;
}

// This gets set here because it appears to be async, so setting it when
// the GSI starts briefly results in a missing max value.
ServerCommand("mp_team_timeout_max %d", maxPauses);
// Make sure mp_team_timeout_max is correct. We need to use a ConVar handle so the
// change is not async, or a (potentially) incorrect max value will flash on the first tick of the
// pause if the pause is called during freezetime.
ConVar timeoutMax = FindConVar("mp_team_timeout_max");
if (timeoutMax) {
timeoutMax.SetInt(maxPauses);
}

PauseGame(team, Get5PauseType_Tactical);

Expand Down

0 comments on commit 12ed9f7

Please sign in to comment.