Skip to content

Commit 04e78f4

Browse files
ficool2mastercoms
authored andcommitted
Add convar to control max MvM robots
1 parent 87d9e0a commit 04e78f4

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

src/game/server/tf/player_vs_environment/tf_population_manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2626,7 +2626,7 @@ void CPopulationManager::AllocateBots()
26262626
Warning( "%d bots were already allocated some how before CPopulationManager::AllocateBots was called\n", botVector.Count() );
26272627
}
26282628

2629-
for ( int i = nNumEnemyBots; i < MVM_INVADERS_TEAM_SIZE; ++i )
2629+
for ( int i = nNumEnemyBots; i < tf_mvm_max_invaders.GetInt(); ++i )
26302630
{
26312631
CTFBot* newBot = NextBotCreatePlayerBot< CTFBot >( "TFBot", false );
26322632
if ( newBot )

src/game/server/tf/player_vs_environment/tf_population_manager.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ class CPopulationManager : public CPointEntity, public CGameEventListener
137137
bool IsBonusRound() const { return m_bBonusRound; }
138138
CBaseCombatCharacter* GetBonusBoss() const { return m_hBonusBoss; }
139139

140-
enum { MVM_INVADERS_TEAM_SIZE = 22 };
141-
142140
static bool GetWavesUseReadyBetween() { return true; }
143141

144142
void SetDefaultEventChangeAttributesName( const char* pszDefaultEventChangeAttributesName ) { m_defaultEventChangeAttributesName = pszDefaultEventChangeAttributesName; }

src/game/server/tf/player_vs_environment/tf_populator_spawners.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ bool CTFBotSpawner::Spawn( const Vector &rawHere, EntityHandleVector_t *result )
10141014

10151015
nNumEnemyBots = botVector.Count();
10161016

1017-
if ( nNumEnemyBots >= CPopulationManager::MVM_INVADERS_TEAM_SIZE )
1017+
if ( nNumEnemyBots >= tf_mvm_max_invaders.GetInt() )
10181018
{
10191019
// no room for more
10201020
if ( tf_populator_debug.GetBool() )
@@ -1023,10 +1023,10 @@ bool CTFBotSpawner::Spawn( const Vector &rawHere, EntityHandleVector_t *result )
10231023
}
10241024

10251025
// extra guard if we're over full on bots
1026-
if ( nNumEnemyBots > CPopulationManager::MVM_INVADERS_TEAM_SIZE )
1026+
if ( nNumEnemyBots > tf_mvm_max_invaders.GetInt() )
10271027
{
10281028
// Kick bots until we are at the proper number starting with spectator bots
1029-
int iNumberToKick = nNumEnemyBots - CPopulationManager::MVM_INVADERS_TEAM_SIZE;
1029+
int iNumberToKick = nNumEnemyBots - tf_mvm_max_invaders.GetInt();
10301030
int iKickedBots = 0;
10311031

10321032
// loop through spectators and invaders in that order

src/game/server/tf/player_vs_environment/tf_populators.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ bool CMissionPopulator::UpdateMission( CTFBot::MissionType mission )
741741
// are there enough free slots?
742742
int currentEnemyCount = GetGlobalTeam( TF_TEAM_PVE_INVADERS )->GetNumPlayers();
743743

744-
if ( currentEnemyCount + m_desiredCount > CPopulationManager::MVM_INVADERS_TEAM_SIZE )
744+
if ( currentEnemyCount + m_desiredCount > tf_mvm_max_invaders.GetInt() )
745745
{
746746
// not enough slots yet
747747
if ( tf_populator_debug.GetBool() )
@@ -1578,7 +1578,7 @@ void CWaveSpawnPopulator::Update( void )
15781578

15791579
int currentEnemyCount = GetGlobalTeam( TF_TEAM_PVE_INVADERS )->GetNumPlayers();
15801580

1581-
if ( currentEnemyCount + m_spawnCount + m_reservedPlayerSlotCount > CPopulationManager::MVM_INVADERS_TEAM_SIZE )
1581+
if ( currentEnemyCount + m_spawnCount + m_reservedPlayerSlotCount > tf_mvm_max_invaders.GetInt() )
15821582
{
15831583
// no space right now
15841584
return;

src/game/shared/tf/tf_gamerules.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,7 @@ ConVar tf_raid_allow_overtime( "tf_raid_allow_overtime", "0"/*, FCVAR_CHEAT*/ );
875875

876876
ConVar tf_mvm_defenders_team_size( "tf_mvm_defenders_team_size", "6", FCVAR_REPLICATED | FCVAR_NOTIFY, "Maximum number of defenders in MvM" );
877877
ConVar tf_mvm_max_connected_players( "tf_mvm_max_connected_players", "10", FCVAR_GAMEDLL, "Maximum number of connected real players in MvM" );
878+
ConVar tf_mvm_max_invaders( "tf_mvm_max_invaders", "22", FCVAR_GAMEDLL, "Maximum number of invaders in MvM" );
878879

879880
ConVar tf_mvm_min_players_to_start( "tf_mvm_min_players_to_start", "3", FCVAR_REPLICATED | FCVAR_NOTIFY, "Minimum number of players connected to start a countdown timer" );
880881
ConVar tf_mvm_respec_enabled( "tf_mvm_respec_enabled", "1", FCVAR_CHEAT | FCVAR_REPLICATED, "Allow players to refund credits spent on player and item upgrades." );

src/game/shared/tf/tf_gamerules.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ class CMannVsMachineUpgrades;
9797
//extern ConVar tf_populator_damage_multiplier;
9898

9999
extern ConVar tf_mvm_defenders_team_size;
100+
extern ConVar tf_mvm_max_invaders;
100101

101102
const int kLadder_TeamSize_6v6 = 6;
102103
const int kLadder_TeamSize_9v9 = 9;

0 commit comments

Comments
 (0)