From 8b1b56532f0a8d48773e5459f126efab8a059208 Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 28 Aug 2017 00:33:02 +0200 Subject: [PATCH] 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 --- qcsrc/server/bot/default/bot.qc | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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); -- 2.39.2