From 0e9f948616d3767c18a54aed8ffac3ccc0251c41 Mon Sep 17 00:00:00 2001 From: Robin Lidbetter Date: Thu, 24 Nov 2022 22:03:40 -0500 Subject: [PATCH] prevent infinite warmup restart message when sm_retakes_warmuptime < 6 --- cfg/sourcemod/retakes/retakes_game.cfg | 2 -- scripting/retakes.sp | 4 +++- scripting/retakes/generic.sp | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cfg/sourcemod/retakes/retakes_game.cfg b/cfg/sourcemod/retakes/retakes_game.cfg index b90cf2f..19f601d 100644 --- a/cfg/sourcemod/retakes/retakes_game.cfg +++ b/cfg/sourcemod/retakes/retakes_game.cfg @@ -3,7 +3,6 @@ bot_kick bot_quota 0 cash_team_bonus_shorthanded 0 mp_autoteambalance 0 -mp_do_warmup_period 1 mp_forcecamera 1 mp_give_player_c4 0 mp_halftime 0 @@ -16,7 +15,6 @@ mp_respawn_on_death_ct 0 mp_respawn_on_death_t 0 mp_solid_teammates 1 mp_teamcashawards 0 -mp_warmup_pausetimer 0 mp_molotovusedelay 0 // Things you can change, and may want to: diff --git a/scripting/retakes.sp b/scripting/retakes.sp index e9be04c..0190295 100644 --- a/scripting/retakes.sp +++ b/scripting/retakes.sp @@ -257,7 +257,9 @@ public void OnMapStart() { ExecConfigs(); // Restart warmup for players to connect. - StartTimedWarmup(g_WarmupTimeCvar.IntValue); + if (g_WarmupTimeCvar.IntValue > 0) { + StartTimedWarmup(g_WarmupTimeCvar.IntValue); + } } public void OnMapEnd() { diff --git a/scripting/retakes/generic.sp b/scripting/retakes/generic.sp index 9d6dc43..b8a9930 100644 --- a/scripting/retakes/generic.sp +++ b/scripting/retakes/generic.sp @@ -257,6 +257,11 @@ stock void StartPausedWarmup() { } stock void StartTimedWarmup(int time) { + // avoid infinite warmup start spam + if (time < 6) { + time = 6; + } + ServerCommand("mp_do_warmup_period 1"); ServerCommand("mp_warmup_pausetimer 0"); ServerCommand("mp_warmuptime %d", time);