]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
When bot_vs_human is enabled ignore team assignment in the bot config file
authorterencehill <piuntn@gmail.com>
Sat, 21 Dec 2019 23:38:53 +0000 (00:38 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 21 Dec 2019 23:38:53 +0000 (00:38 +0100)
qcsrc/server/bot/default/bot.qc
qcsrc/server/teamplay.qc

index 40afed17990b7e93c40e41e194b5893054c54911..1ab7e9737c0529d4c8b714f0e49ea5d222b3b594 100644 (file)
@@ -211,7 +211,10 @@ void bot_setnameandstuff(entity this)
        if(argv(4) != "" && stof(argv(4)) >= 0) bot_pants = argv(4);
        else bot_pants = ftos(floor(random() * 15));
 
-       this.bot_forced_team = stof(argv(5));
+       if (teamplay && autocvar_bot_vs_human && AvailableTeams() == 2)
+               this.bot_forced_team = 0;
+       else
+               this.bot_forced_team = stof(argv(5));
 
        prio = 6;
 
index ff9438e76d84b205679a05982d5b8bc1eb0b57f3..a7c7205c1fb5781bec8edf30adc0dfa5a2a3fc12 100644 (file)
@@ -496,8 +496,7 @@ entity TeamBalance_CheckAllowedTeams(entity for_whom)
        }
 
        // TODO: Balance quantity of bots across > 2 teams when bot_vs_human is set (and remove next line)
-       if (AvailableTeams() == 2)
-       if (autocvar_bot_vs_human && for_whom)
+       if (autocvar_bot_vs_human && AvailableTeams() == 2 && for_whom)
        {
                if (autocvar_bot_vs_human > 0)
                {