fix disablecac

This commit is contained in:
ineedbots 2021-09-09 21:22:04 -06:00
parent 5884d1064b
commit c5cf283262
2 changed files with 32 additions and 0 deletions

View File

@ -590,10 +590,31 @@ connected()
self thread teamWatch(); self thread teamWatch();
self thread classWatch(); self thread classWatch();
self thread onBotSpawned();
self thread setPrestige(); self thread setPrestige();
} }
/*
When the bot spawns
*/
onBotSpawned()
{
self endon( "disconnect" );
for ( ;; )
{
self waittill( "spawned_player" );
waittillframeend;
self.bot_first_spawn = undefined;
if ( randomInt( 100 ) < 2 )
self.bot_change_class = undefined;
}
}
/* /*
Set pres Set pres
*/ */
@ -656,6 +677,17 @@ classWatch()
*/ */
chooseRandomClass() chooseRandomClass()
{ {
if ( level.disablecac )
{
classes = [];
classes[classes.size] = "class_assault";
classes[classes.size] = "class_smg";
classes[classes.size] = "class_lmg";
classes[classes.size] = "class_cqb";
classes[classes.size] = "class_sniper";
return PickRandom( classes );
}
return PickRandom( self maps\mp\bots\_bot::bot_build_classes() ); return PickRandom( self maps\mp\bots\_bot::bot_build_classes() );
} }