Skip to content

Commit

Permalink
prevent infinite warmup restart message when sm_retakes_warmuptime < 6
Browse files Browse the repository at this point in the history
  • Loading branch information
Lidbetter committed Nov 28, 2022
1 parent 8cc75f1 commit 0e9f948
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 0 additions & 2 deletions cfg/sourcemod/retakes/retakes_game.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion scripting/retakes.sp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
5 changes: 5 additions & 0 deletions scripting/retakes/generic.sp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0e9f948

Please sign in to comment.