From 67bb1f55ed78357ec53a345b89cbd51d16def50e Mon Sep 17 00:00:00 2001 From: Nicolai Cornelis Date: Thu, 21 Jul 2022 17:15:35 +0200 Subject: [PATCH] Adjust EnsurePausedWarmup and renamed it to EnsureIndefiniteWarmup (#777) * 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 --- scripting/get5.sp | 8 ++++---- scripting/get5/backups.sp | 2 +- scripting/get5/matchconfig.sp | 2 +- scripting/get5/util.sp | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/scripting/get5.sp b/scripting/get5.sp index 628c97c3c..49adf6899 100644 --- a/scripting/get5.sp +++ b/scripting/get5.sp @@ -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(); } } @@ -778,7 +778,7 @@ public void OnMapStart() { ExecCfg(g_LiveCfgCvar); SetMatchTeamCvars(); ExecuteMatchConfigCvars(); - EnsurePausedWarmup(); + EnsureIndefiniteWarmup(); } } @@ -794,7 +794,7 @@ public void OnConfigsExecuted() { ExecCfg(g_WarmupCfgCvar); SetMatchTeamCvars(); ExecuteMatchConfigCvars(); - EnsurePausedWarmup(); + EnsureIndefiniteWarmup(); } } @@ -1558,7 +1558,7 @@ public Action Timer_PostKnife(Handle timer) { } ExecCfg(g_WarmupCfgCvar); - EnsurePausedWarmup(); + EnsureIndefiniteWarmup(); } public Action StopDemo(Handle timer) { diff --git a/scripting/get5/backups.sp b/scripting/get5/backups.sp index f0ac3f78e..4f416b91a 100644 --- a/scripting/get5/backups.sp +++ b/scripting/get5/backups.sp @@ -360,7 +360,7 @@ public void RestoreGet5Backup() { CreateTimer(6.0, Timer_SwapCoaches); } } else { - EnsurePausedWarmup(); + EnsureIndefiniteWarmup(); } g_DoingBackupRestoreNow = false; diff --git a/scripting/get5/matchconfig.sp b/scripting/get5/matchconfig.sp index 6e58fd12e..acfb910e1 100644 --- a/scripting/get5/matchconfig.sp +++ b/scripting/get5/matchconfig.sp @@ -121,7 +121,7 @@ stock bool LoadMatchConfig(const char[] config, bool restoreBackup = false) { ExecCfg(g_WarmupCfgCvar); ExecuteMatchConfigCvars(); LoadPlayerNames(); - EnsurePausedWarmup(); + EnsureIndefiniteWarmup(); Stats_InitSeries(); diff --git a/scripting/get5/util.sp b/scripting/get5/util.sp index 1a055ea6e..4c7b90582 100644 --- a/scripting/get5/util.sp +++ b/scripting/get5/util.sp @@ -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) {