From 61568dc03276725627fc831eae42256af604d93d Mon Sep 17 00:00:00 2001 From: jenz Date: Sat, 16 May 2026 14:38:57 +0200 Subject: [PATCH] preventing first map after server crash/restart to go on cooldown --- .../scripting/mapchooser_extended_avg_mapend.sp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mapchooser_extended/scripting/mapchooser_extended_avg_mapend.sp b/mapchooser_extended/scripting/mapchooser_extended_avg_mapend.sp index 4176a93..446c01f 100755 --- a/mapchooser_extended/scripting/mapchooser_extended_avg_mapend.sp +++ b/mapchooser_extended/scripting/mapchooser_extended_avg_mapend.sp @@ -188,6 +188,8 @@ int g_mapOfficialFileSerial = -1; char g_GameModName[64]; bool g_WarningInProgress = false; bool g_AddNoVote = false; +//prevent first map after server crash from going on cooldown. +bool g_first_map_no_cooldown = false; RoundCounting g_RoundCounting = RoundCounting_Standard; @@ -421,6 +423,7 @@ public void OnPluginStart() InternalRestoreMapCooldowns(); + g_first_map_no_cooldown = true; int total_time = (GetConVarInt(g_Cvar_VoteDuration) * 2) + GetConVarInt(g_Cvar_RunOffWarningTime) + 10; ServerCommand("sm_cvar mp_chattime %i", total_time); //prevents map switching supposedly. @@ -630,6 +633,7 @@ public void SetSharedCooldowns(char[] map) public void OnMapEnd() { + g_first_map_no_cooldown = false; g_iNextmapState = 0; g_RtvInitiated = false; int total_time = (GetConVarInt(g_Cvar_VoteDuration) * 2) + GetConVarInt(g_Cvar_RunOffWarningTime) + 10; @@ -969,7 +973,7 @@ public Action CS_OnTerminateRound(float &delay, CSRoundEndReason &reason) //0 timeleft and rtv is ongoing still //yeah sure why not just do it on every round end anyways. - if (GetClientCount(false) > g_iDontCooldownMap) + if (GetClientCount(false) > g_iDontCooldownMap && !g_first_map_no_cooldown) { static char map[PLATFORM_MAX_PATH]; GetCurrentMap(map, PLATFORM_MAX_PATH);