From: TimePath Date: Sun, 18 Oct 2015 06:14:13 +0000 (+1100) Subject: Bots: fix fix count X-Git-Tag: xonotic-v0.8.2~1801^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=fbcd88ad80bececcbd21f10564295437a85bd27e;p=xonotic%2Fxonotic-data.pk3dir.git Bots: fix fix count --- diff --git a/qcsrc/server/bot/bot.qc b/qcsrc/server/bot/bot.qc index fb7662328..c607de4f4 100644 --- a/qcsrc/server/bot/bot.qc +++ b/qcsrc/server/bot/bot.qc @@ -566,14 +566,13 @@ void bot_calculate_stepheightvec(void) float bot_fixcount() { - entity head; - float realplayers, bots, activerealplayers; - - activerealplayers = 0; - realplayers = 0; - - if(!MUTATOR_CALLHOOK(Bot_FixCount, activerealplayers, realplayers)) - { + int activerealplayers = 0; + int realplayers = 0; + if (MUTATOR_CALLHOOK(Bot_FixCount, activerealplayers, realplayers)) { + activerealplayers = bot_activerealplayers; + realplayers = bot_realplayers; + } else { + entity head; FOR_EACH_REALCLIENT(head) { if(IS_PLAYER(head)) @@ -582,9 +581,7 @@ float bot_fixcount() } } - activerealplayers = bot_activerealplayers; - realplayers = bot_realplayers; - + int bots; // add/remove bots if needed to make sure there are at least // minplayers+bot_number, or remove all bots if no one is playing // But don't remove bots immediately on level change, as the real players