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);
}
PlayerState_attach(this);
accuracy_resend(this);
+ if (IS_BOT_CLIENT(this))
+ {
+ if (teamplay && Team_IsValidIndex(this.bot_forced_team))
+ SetPlayerTeam(this, this.bot_forced_team, TEAM_CHANGE_MANUAL);
+ else
+ this.bot_forced_team = 0;
+ }
+
if (this.team < 0)
TeamBalance_JoinBestTeam(this);
/** Called when a client spawns in the server */
void PutClientInServer(entity this)
{
- if (IS_BOT_CLIENT(this)) {
- TRANSMUTE(Player, this);
- } else if (IS_REAL_CLIENT(this)) {
+ if (IS_REAL_CLIENT(this)) {
msg_entity = this;
WriteByte(MSG_ONE, SVC_SETVIEW);
WriteEntity(MSG_ONE, this);
}
}
+ if (IS_BOT_CLIENT(this) && !CS(this).autojoin_checked)
+ {
+ CS(this).autojoin_checked = true;
+ TRANSMUTE(Player, this);
+ PutClientInServer(this);
+ return;
+ }
+
if (this.flags & FL_JUMPRELEASED) {
if (PHYS_INPUT_BUTTON_JUMP(this) && (joinAllowed(this) || time < CS(this).jointime + MIN_SPEC_TIME)) {
this.flags &= ~FL_JUMPRELEASED;