Swap on spawn

This commit is contained in:
INeedBots 2021-03-26 00:30:39 -06:00
parent 4eda1dfb54
commit 2aa84350cb

View File

@ -2529,6 +2529,7 @@ follow_target()
} }
/* /*
Fast swaps or reload cancels don't work cause t5 bots wait for the anim to complete
Bots will think to switch weapons Bots will think to switch weapons
*/ */
bot_weapon_think() bot_weapon_think()
@ -2536,6 +2537,8 @@ bot_weapon_think()
self endon("death"); self endon("death");
self endon("disconnect"); self endon("disconnect");
level endon("game_ended"); level endon("game_ended");
first = true;
for(;;) for(;;)
{ {
@ -2556,13 +2559,23 @@ bot_weapon_think()
if (isDefined(threat) && !isPlayer(threat)) if (isDefined(threat) && !isPlayer(threat))
continue; continue;
if(curWeap != "none" && self getAmmoCount(curWeap) && curWeap != "strela_mp") if (first)
{ {
if(randomInt(100) > 2) first = false;
if (randomInt(100) > 10)
continue; continue;
}
else
{
if(curWeap != "none" && self getAmmoCount(curWeap) && curWeap != "strela_mp")
{
if(randomInt(100) > 2)
continue;
if(isDefined(threat)) if(isDefined(threat))
continue; continue;
}
} }
weaponslist = self getweaponslist(); weaponslist = self getweaponslist();