X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fbot%2Fdefault%2Fbot.qc;h=a42b0609a191ccf9e063de4d429807ccdbb2e59b;hb=0121566a6e21d8cad4438da85c344a86c21e57b8;hp=79f939196debf87b07d548e39ca96870261b2e0e;hpb=4f4c471a6ba861785a118487ac2ddadaead70d52;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/bot/default/bot.qc b/qcsrc/server/bot/default/bot.qc index 79f939196..a42b0609a 100644 --- a/qcsrc/server/bot/default/bot.qc +++ b/qcsrc/server/bot/default/bot.qc @@ -28,6 +28,7 @@ #include #include #include +#include #include STATIC_INIT(bot) { bot_calculate_stepheightvec(); } @@ -106,6 +107,9 @@ void bot_think(entity this) 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; @@ -233,7 +237,11 @@ void bot_setnameandstuff(entity this) 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; @@ -438,16 +446,6 @@ void bot_clientconnect(entity this) 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); } @@ -677,6 +675,7 @@ void bot_serverframe() // 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;