]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'refs/remotes/origin/terencehill/bot_vs_human_fix'
authorRudolf Polzer <divverent@alientrap.org>
Tue, 15 Jun 2010 09:08:10 +0000 (11:08 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 15 Jun 2010 09:08:10 +0000 (11:08 +0200)
defaultXonotic.cfg
qcsrc/server/arena.qc
qcsrc/server/bot/bot.qc
qcsrc/server/cl_player.qc

index fd4c100ceb2a164ad643eb2b9dbcbdba95490c8e..725510d95f7a3610976aed0ceaa816cb0f4840c2 100644 (file)
@@ -460,7 +460,7 @@ set bot_ai_aimskill_order_filter_5th 0.5 "Movement prediction filter. Used rarel
 set g_waypointeditor 0
 set bot_ignore_bots 0  "When set, bots don't shoot at other bots"
 set bot_join_empty 0   "When set, bots also play if no player has joined the server"
-set bot_vs_human 0     "Bots and humans play in different teams when set. positive values to make an all-bot blue team, set to negative values to make an all-bot red team, the absolute value is the ratio bots vs humans (1 for equal count)"
+set bot_vs_human 0     "Bots and humans play in different teams when set. positive values to make an all-bot blue team, set to negative values to make an all-bot red team, the absolute value is the ratio bots vs humans (1 for equal count). Changes will be correctly applied only from the next game"
 
 alias g_waypointeditor_spawn "impulse 103"
 alias g_waypointeditor_remove "impulse 104"
index 5dd01d4ddf58a18aafc5404bcce1045710658f0b..e68e295022f29ecfe2ef3e579f47caded8ecfdf8 100644 (file)
@@ -11,6 +11,7 @@ entity champion;
 float warmup;
 float allowed_to_spawn;
 float player_cnt;
+float required_ca_players;
 .float caplayer;
 
 void PutObserverInServer();
@@ -43,7 +44,7 @@ void reset_map(float dorespawn)
        lms_next_place = player_count;
 
        race_ReadyRestart();
-       
+
        for(self = world; (self = nextent(self)); )
        if(clienttype(self) == CLIENTTYPE_NOTACLIENT)
        {
@@ -198,7 +199,7 @@ void Arena_Warmup()
 
        allowed_to_spawn = 0;
 
-       if(g_ca && (player_cnt < 2 || inWarmupStage))
+       if(g_ca && (player_cnt < required_ca_players || inWarmupStage))
                allowed_to_spawn = 1;
 
        msg = NEWLINES;
@@ -280,13 +281,15 @@ void Spawnqueue_Check()
                        }
                }
 
-               if(player_cnt < 2 && (redspawned && bluespawned)) {
+               required_ca_players = max(2, fabs(cvar("bot_vs_human") + 1));
+
+               if(player_cnt < required_ca_players && (redspawned && bluespawned)) {
                        reset_map(TRUE);
                }
-               else if(player_cnt < 2) {
+               else if(player_cnt < required_ca_players) {
                        FOR_EACH_CLIENT(self) 
                        if(self.classname == "player")
-                               centerprint(self, strcat("^1Need at least 2 players to play CA", "^7\n"));
+                               centerprint(self, strcat("^1Need at least 1 player in each team to play CA", "^7\n"));
 
                        allowed_to_spawn = 1;
                        return;
index 44ece52bfd9c66cd2caf0d67af3ce2c4c0256d4e..940782c8239d9538f474405d87d7b21f967dc447 100644 (file)
@@ -544,7 +544,7 @@ void bot_serverframe()
 
        FOR_EACH_REALCLIENT(head)
        {
-               if(head.classname == "player" || g_lms || g_arena)
+               if(head.classname == "player" || g_lms || g_arena || g_ca)
                        ++activerealplayers;
                ++realplayers;
        }
index b3f0e3ee5aac7fd72f57ea2a4b9e3c5eb570519f..3911ffecb89a5db3921992c8f729f91808f08dfa 100644 (file)
@@ -433,7 +433,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
        else
                Violence_GibSplash_At(hitloc, force, 2, bound(0, damage, 200) / 16, self, attacker);
 
-       if((g_arena && numspawned < 2) || (g_ca && player_cnt < 2) && !inWarmupStage)
+       if((g_arena && numspawned < 2) || (g_ca && player_cnt < required_ca_players) && !inWarmupStage)
                return;
 
        if (!g_minstagib)