From: Mario Date: Sun, 30 Sep 2018 12:29:06 +0000 (+1000) Subject: Use the new player limit function for limiting bot count X-Git-Tag: xonotic-v0.8.5~1809^2 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=3b0a06185f8581577825241de865998e409ed638 Use the new player limit function for limiting bot count --- diff --git a/qcsrc/server/bot/default/bot.qc b/qcsrc/server/bot/default/bot.qc index d9d05773e4..0c4668f2f3 100644 --- a/qcsrc/server/bot/default/bot.qc +++ b/qcsrc/server/bot/default/bot.qc @@ -593,7 +593,6 @@ float bot_fixcount() }); } - //int player_limit = GetPlayerLimit(); // TODO: use this instead of maxclients! int bots; // But don't remove bots immediately on level change, as the real players // usually haven't rejoined yet @@ -608,8 +607,9 @@ 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); + int player_limit = GetPlayerLimit(); + if(player_limit) + bots = min(bots, player_limit - activerealplayers); bots = min(bots, maxclients - realplayers); if(bots > minbots)