File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1173,7 +1173,7 @@ ETFClass CTFBot::GetPresetClassToSpawn() const
11731173 {
11741174 ETFClass iClass = desiredRoster[i];
11751175
1176- if ( currentRoster.m_count [ iClass ] > classCount[ iClass ] )
1176+ if ( currentRoster.m_count [ iClass ] > classCount[ iClass ] || ! TFGameRules ()-> CanBotChooseClass ( const_cast < CTFBot * >( this ), iClass ) )
11771177 {
11781178 // if we have enough of this class, skip it
11791179 classCount[ iClass ]++;
@@ -1229,6 +1229,10 @@ const char *CTFBot::GetNextSpawnClassname( void )
12291229 {
12301230 iNextClass = (ETFClass)GetClassIndexFromString ( pszForceClass );
12311231 }
1232+ if ( !TFGameRules ()->CanPlayerChooseClass ( const_cast < CTFBot * >( this ), iNextClass ) )
1233+ {
1234+ iNextClass = TF_CLASS_UNDEFINED;
1235+ }
12321236
12331237 if ( m_iReservedPlayerClass != TF_CLASS_UNDEFINED )
12341238 {
You can’t perform that action at this time.
0 commit comments