Skip to content

Commit facc771

Browse files
committed
add custom mvm team sizes for better playtests
1 parent 1d3f032 commit facc771

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

game/client/tf/vgui/tf_teammenu.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,8 @@ void CTFTeamMenu::SetHighlanderTeamsFullPanels( bool bTeamsFull, bool bForce /*
752752
}
753753
}
754754

755+
ConVar tf_sv_mvm_forced_players("tf_sv_mvm_forced_players", "0", FCVAR_REPLICATED);
756+
755757
//-----------------------------------------------------------------------------
756758
// Frame-based update
757759
//-----------------------------------------------------------------------------
@@ -810,11 +812,18 @@ void CTFTeamMenu::OnTick()
810812
bool bUnbalanced = pRules->AreTeamsUnbalanced( iHeavyTeam, iLightTeam );
811813

812814
int iCurrentTeam = pLocalPlayer->GetTeamNumber();
815+
816+
int iTeamSize = kMVM_DefendersTeamSize;
817+
818+
if (tf_sv_mvm_forced_players.GetInt() > iTeamSize)
819+
{
820+
iTeamSize = tf_sv_mvm_forced_players.GetInt();
821+
}
813822

814823
if ( ( bUnbalanced && iHeavyTeam == TF_TEAM_RED ) ||
815824
( pRules->WouldChangeUnbalanceTeams( TF_TEAM_RED, iCurrentTeam ) ) ||
816825
( bHighlander && GetGlobalTeam( TF_TEAM_RED )->GetNumPlayers() >= TF_LAST_NORMAL_CLASS - 1 ) ||
817-
( pRules->IsMannVsMachineMode() && ( GetGlobalTeam( TF_TEAM_RED )->GetNumPlayers() >= kMVM_DefendersTeamSize ) ) )
826+
( pRules->IsMannVsMachineMode() && ( GetGlobalTeam( TF_TEAM_RED )->GetNumPlayers() >= iTeamSize ) ) )
818827
{
819828
m_bRedDisabled = true;
820829
}

game/server/tf/tf_gc_server.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,6 +1593,8 @@ void CTFGCServerSystem::ClientDisconnected( CSteamID steamIDClient )
15931593
}
15941594
}
15951595

1596+
ConVar tf_sv_mvm_forced_players("tf_sv_mvm_forced_players", "0", FCVAR_REPLICATED);
1597+
15961598
//-----------------------------------------------------------------------------
15971599
void CTFGCServerSystem::PreClientUpdate( )
15981600
{
@@ -1698,6 +1700,10 @@ void CTFGCServerSystem::PreClientUpdate( )
16981700
}
16991701

17001702
int playerCount = kMVM_DefendersTeamSize + spectatorCount;
1703+
if (tf_sv_mvm_forced_players.GetInt() > playerCount)
1704+
{
1705+
playerCount = tf_sv_mvm_forced_players.GetInt();
1706+
}
17011707
if ( sv_visiblemaxplayers.GetInt() <= 0 || sv_visiblemaxplayers.GetInt() != playerCount )
17021708
{
17031709
MMLog( "Setting sv_visiblemaxplayers to %d for MvM\n", playerCount );

0 commit comments

Comments
 (0)