#include <server/scores_rules.qh>
#include <server/teamplay.qh>
#include <server/weapons/accuracy.qh>
+#include <server/weapons/selection.qh>
#include <server/world.qh>
STATIC_INIT(bot) { bot_calculate_stepheightvec(); }
if (time < game_starttime)
{
+ .entity weaponentity = weaponentities[0];
+ if(this.(weaponentity).m_weapon == WEP_Null)
+ W_NextWeapon(this, 0, weaponentity);
// block the bot during the countdown to game start
CS(this).movement = '0 0 0';
this.bot_nextthink = game_starttime;
else bot_pants = ftos(floor(random() * 15));
if (teamplay && !(autocvar_bot_vs_human && AvailableTeams() == 2))
+ {
this.bot_forced_team = stof(argv(5));
+ if (!Team_IsValidIndex(this.bot_forced_team))
+ this.bot_forced_team = 0;
+ }
else
this.bot_forced_team = 0;
bot_setclientfields(this);
}
- if (teamplay && Team_IsValidIndex(this.bot_forced_team))
- {
- SetPlayerTeam(this, this.bot_forced_team, TEAM_CHANGE_MANUAL);
- }
- else
- {
- this.bot_forced_team = 0;
- TeamBalance_JoinBestTeam(this);
- }
-
havocbot_setupbot(this);
}
// spectators in the scoreboard and never go away. This issue happens at time 2 if map is changed
// with the gotomap command, minplayers is > 1 and human clients join as players very soon
// either intentionally or automatically (sv_spectate 0)
+ // A working workaround for this bug was implemented in commit fbd145044, see entcs_attach
if (time < 2.5)
{
currentbots = -1;