Skip to content

Commit

Permalink
Adjust EnsurePausedWarmup and renamed it to EnsureIndefiniteWarmup (#777
Browse files Browse the repository at this point in the history
)

* Remove extraneous calls to mp_warmup_pausetimer 1 and mp_do_warmup_period 1 in EnsurePausedWarmup
* Rename EnsurePausedWarmup to more appropriate EnsureIndefiniteWarmup since no pausing takes place
  • Loading branch information
nickdnk authored Jul 21, 2022
1 parent 11b50da commit 67bb1f5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions scripting/get5.sp
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ public void OnClientPutInServer(int client) {
if (g_GameState <= Get5State_Warmup && g_GameState != Get5State_None) {
if (GetRealClientCount() <= 1) {
ExecCfg(g_WarmupCfgCvar);
EnsurePausedWarmup();
EnsureIndefiniteWarmup();
}
}

Expand Down Expand Up @@ -778,7 +778,7 @@ public void OnMapStart() {
ExecCfg(g_LiveCfgCvar);
SetMatchTeamCvars();
ExecuteMatchConfigCvars();
EnsurePausedWarmup();
EnsureIndefiniteWarmup();
}
}

Expand All @@ -794,7 +794,7 @@ public void OnConfigsExecuted() {
ExecCfg(g_WarmupCfgCvar);
SetMatchTeamCvars();
ExecuteMatchConfigCvars();
EnsurePausedWarmup();
EnsureIndefiniteWarmup();
}
}

Expand Down Expand Up @@ -1558,7 +1558,7 @@ public Action Timer_PostKnife(Handle timer) {
}

ExecCfg(g_WarmupCfgCvar);
EnsurePausedWarmup();
EnsureIndefiniteWarmup();
}

public Action StopDemo(Handle timer) {
Expand Down
2 changes: 1 addition & 1 deletion scripting/get5/backups.sp
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ public void RestoreGet5Backup() {
CreateTimer(6.0, Timer_SwapCoaches);
}
} else {
EnsurePausedWarmup();
EnsureIndefiniteWarmup();
}

g_DoingBackupRestoreNow = false;
Expand Down
2 changes: 1 addition & 1 deletion scripting/get5/matchconfig.sp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ stock bool LoadMatchConfig(const char[] config, bool restoreBackup = false) {
ExecCfg(g_WarmupCfgCvar);
ExecuteMatchConfigCvars();
LoadPlayerNames();
EnsurePausedWarmup();
EnsureIndefiniteWarmup();

Stats_InitSeries();

Expand Down
10 changes: 5 additions & 5 deletions scripting/get5/util.sp
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,14 @@ stock bool InFreezeTime() {
return GameRules_GetProp("m_bFreezePeriod") != 0;
}

stock void EnsurePausedWarmup() {
stock void EnsureIndefiniteWarmup() {
if (!InWarmup()) {
StartWarmup();
} else {
ServerCommand("mp_warmup_pausetimer 1");
ServerCommand("mp_do_warmup_period 1");
ServerCommand("mp_warmup_pausetimer 1");
}

ServerCommand("mp_warmup_pausetimer 1");
ServerCommand("mp_do_warmup_period 1");
ServerCommand("mp_warmup_pausetimer 1");
}

stock void StartWarmup(bool indefiniteWarmup = true, int warmupTime = 60) {
Expand Down

0 comments on commit 67bb1f5

Please sign in to comment.