]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
After the end of the match all bots stay unless all human players disconnect; it...
authorterencehill <piuntn@gmail.com>
Tue, 23 Jan 2018 15:27:41 +0000 (16:27 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 23 Jan 2018 15:33:05 +0000 (16:33 +0100)
qcsrc/server/bot/default/bot.qc

index 9eae91d85bad5209b47d9728a2a75b18809b5b22..a605fc0689e73259ba266cd41047ca573bb252ad 100644 (file)
@@ -679,6 +679,19 @@ void bot_clear(entity this)
 
 void bot_serverframe()
 {
+       if (intermission_running && currentbots > 0)
+       {
+               // after the end of the match all bots stay unless all human players disconnect
+               int realplayers = 0;
+               FOREACH_CLIENT(IS_REAL_CLIENT(it), { ++realplayers; });
+               if (!realplayers)
+               {
+                       FOREACH_CLIENT(IS_BOT_CLIENT(it), { dropclient(it); });
+                       currentbots = 0;
+               }
+               return;
+       }
+
        if (game_stopped)
                return;