Skip to content

[TF2 Feature Request] Add mp_timelimit_min to control the min time limit required to switch maps after a round ends #1206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/game/shared/multiplay_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
5 changes: 2 additions & 3 deletions src/game/shared/teamplayroundbased_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down