Skip to content

Commit

Permalink
Maintain Pause Count On Match Restore (#770)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhlexPlexico authored Jul 8, 2022
1 parent 8b34eb9 commit d614196
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 7 additions & 2 deletions scripting/get5/matchconfig.sp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ stock bool LoadMatchConfig(const char[] config, bool restoreBackup = false) {
g_TeamReadyForUnpause[team] = false;
g_TeamGivenStopCommand[team] = false;
g_TeamPauseTimeUsed[team] = 0;
g_TeamPausesUsed[team] = 0;
g_TeamTechPausesUsed[team] = 0;
// We only reset these on a new game.
// During restore we want to keep our
// current pauses used.
if (!restoreBackup) {
g_TeamPausesUsed[team] = 0;
g_TeamTechPausesUsed[team] = 0;
}
g_TechPausedTimeOverride[team] = 0;
g_TeamGivenTechPauseCommand[team] = false;
ClearArray(GetTeamAuths(team));
Expand Down
3 changes: 1 addition & 2 deletions scripting/get5/pausing.sp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ public Action Command_Pause(int client, int args) {
if (need_resume) {
g_PauseTimeUsed = g_PauseTimeUsed + g_FixedPauseTimeCvar.IntValue - 1;
CreateTimer(1.0, Timer_PauseTimeCheck, team, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
// Keep track of timer, since we don't want several timers created for one pause checking
// instance.
// This timer is used to only fire off the Unpause event.
CreateTimer(1.0, Timer_UnpauseEventCheck, team, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
}

Expand Down

0 comments on commit d614196

Please sign in to comment.