]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make bots obey g_maxplayers 601/head
authorMario <mario@smbclan.net>
Thu, 27 Sep 2018 02:06:03 +0000 (12:06 +1000)
committerMario <mario@smbclan.net>
Thu, 27 Sep 2018 02:06:03 +0000 (12:06 +1000)
qcsrc/server/bot/default/bot.qc

index 2a6164a2826875af507597ba8523bf629bee0403..12e93821f1479246c306490ceb4ec0dfdce9a3d4 100644 (file)
@@ -607,6 +607,8 @@ float bot_fixcount()
                // add bots to reach minplayers if needed
                bots = max(minbots, minplayers - activerealplayers);
                // cap bots to the max players allowed by the server
+               if(autocvar_g_maxplayers)
+                       bots = min(bots, autocvar_g_maxplayers - activerealplayers);
                bots = min(bots, maxclients - realplayers);
 
                if(bots > minbots)