//self.bot_painintensity = self.bot_painintensity + self.bot_oldhealth - self.health;
//self.bot_painintensity = bound(0, self.bot_painintensity, 100);
- if(time < game_starttime || ((cvar("g_campaign") && !campaign_bots_may_start)))
+ if (cvar("g_campaign") && !campaign_bots_may_start)
{
self.nextthink = time + 0.5;
return;
self.BUTTON_CHAT = 0;
self.BUTTON_USE = 0;
+ if (time < game_starttime)
+ {
+ // block the bot during the countdown to game start
+ self.movement = '0 0 0';
+ self.nextthink = game_starttime;
+ return;
+ }
+
// if dead, just wait until we can respawn
if (self.deadflag)
{
prio = 1;
FOR_EACH_CLIENT(p)
{
- if(strcat(prefix, s, suffix) == p.netname)
+ if(clienttype(p) == CLIENTTYPE_BOT)
+ if(s == p.cleanname)
{
prio = 0;
break;
else
name = bot_name;
- self.cleanname = strzone(name);
-
// number bots with identical names
float i;
i = 0;
++i;
}
if (i)
- name = strcat(name, "(", ftos(i), ")");
+ self.netname = self.netname_freeme = strzone(strcat(prefix, name, "(", ftos(i), ")", suffix));
+ else
+ self.netname = self.netname_freeme = strzone(strcat(prefix, name, suffix));
+
+ self.cleanname = strzone(name);
// pick the model and skin
if(substring(bot_model, -4, 1) != ".")
self.playermodel = self.playermodel_freeme = strzone(strcat("models/player/", bot_model));
self.playerskin = self.playerskin_freeme = strzone(bot_skin);
- self.netname = self.netname_freeme = strzone(strcat(prefix, name, suffix));
-
self.cvar_cl_accuracy_data_share = 1; // share the bots weapon accuracy data with the world
self.cvar_cl_accuracy_data_receive = 0; // don't receive any weapon accuracy data
};
// But don't remove bots immediately on level change, as the real players
// usually haven't rejoined yet
bots_would_leave = FALSE;
- if ((realplayers || cvar("bot_join_empty") || (currentbots > 0 && time < 5)))
+ if (teamplay && cvar("bot_vs_human") && (c3==-1 && c4==-1))
+ bots = min(ceil(fabs(cvar("bot_vs_human")) * activerealplayers), maxclients - realplayers);
+ else if ((realplayers || cvar("bot_join_empty") || (currentbots > 0 && time < 5)))
{
float realminplayers, minplayers;
realminplayers = cvar("minplayers");
minplayers = max(0, floor(realminplayers));
float realminbots, minbots;
- if(teamplay && cvar("bot_vs_human"))
- realminbots = ceil(fabs(cvar("bot_vs_human")) * activerealplayers);
- else
- realminbots = cvar("bot_number");
+ realminbots = cvar("bot_number");
minbots = max(0, floor(realminbots));
bots = min(max(minbots, minplayers - activerealplayers), maxclients - realplayers);