From: terencehill Date: Sun, 27 Aug 2017 22:33:02 +0000 (+0200) Subject: Fix bots appearing on the scoreboard as spectators when switching map with the gotoma... X-Git-Tag: xonotic-v0.8.5~2494 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8b1b56532f0a8d48773e5459f126efab8a059208;p=xonotic%2Fxonotic-data.pk3dir.git Fix bots appearing on the scoreboard as spectators when switching map with the gotomap command (it doesn't remove bots of the previous match) and with minplayers > 1 --- diff --git a/qcsrc/server/bot/default/bot.qc b/qcsrc/server/bot/default/bot.qc index 0e6c87b67..f8ddd0c63 100644 --- a/qcsrc/server/bot/default/bot.qc +++ b/qcsrc/server/bot/default/bot.qc @@ -598,6 +598,16 @@ float bot_fixcount() ++realplayers; }); } + if(currentbots == -1) + { + currentbots = 0; + // human players joining early may cause weird issues (bots appearing on + // the scoreboard as spectators) when switching map with the gotomap + // command, as it doesn't remove bots of the previous match, and with + // minplayers > 1, so ignore human players in the first bot frame + // TODO maybe find a cleaner solution + activerealplayers = 0; + } int bots; // add/remove bots if needed to make sure there are at least @@ -684,7 +694,10 @@ void bot_serverframe() return; if (time < 2) + { + currentbots = -1; return; + } bot_calculate_stepheightvec(); bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);