From 43bbf8d64d10e88d30de4a861ca6d8a76ff83ebb Mon Sep 17 00:00:00 2001 From: Bradasparky Date: Fri, 18 Apr 2025 22:40:28 -0400 Subject: [PATCH] Implemented ConVar mp_timelimit_min --- src/game/shared/multiplay_gamerules.cpp | 1 + src/game/shared/teamplayroundbased_gamerules.cpp | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game/shared/multiplay_gamerules.cpp b/src/game/shared/multiplay_gamerules.cpp index 73af2f6943a..cc5137faff5 100644 --- a/src/game/shared/multiplay_gamerules.cpp +++ b/src/game/shared/multiplay_gamerules.cpp @@ -88,6 +88,7 @@ ConVar mp_timelimit( "mp_timelimit", "0", FCVAR_NOTIFY|FCVAR_REPLICATED, "game t , MPTimeLimitCallback #endif ); +ConVar mp_timelimit_min( "mp_timelimit_min", "5", FCVAR_NOTIFY|FCVAR_REPLICATED, "Minimum timelimit (in minutes) when the map should end after a round ends." ); ConVar fraglimit( "mp_fraglimit","0", FCVAR_NOTIFY|FCVAR_REPLICATED, "The number of kills at which the map ends"); diff --git a/src/game/shared/teamplayroundbased_gamerules.cpp b/src/game/shared/teamplayroundbased_gamerules.cpp index d4219a8ff59..3e7065b64c1 100644 --- a/src/game/shared/teamplayroundbased_gamerules.cpp +++ b/src/game/shared/teamplayroundbased_gamerules.cpp @@ -1170,9 +1170,8 @@ bool CTeamplayRoundBasedRules::CheckTimeLimit( bool bAllowEnd /*= true*/ ) if ( ( mp_timelimit.GetInt() > 0 && CanChangelevelBecauseOfTimeLimit() ) || m_bChangelevelAfterStalemate ) { - // If there's less than 5 minutes to go, just switch now. This avoids the problem - // of sudden death modes starting shortly after a new round starts. - const int iMinTime = 5; + extern ConVar mp_timelimit_min; + int iMinTime = mp_timelimit_min.GetInt(); bool bSwitchDueToTime = ( mp_timelimit.GetInt() > iMinTime && GetTimeLeft() < (iMinTime * 60) ); if ( IsInTournamentMode() == true )