From 14800edad1a4c4e2e08ec6a2257184ea2f396d23 Mon Sep 17 00:00:00 2001 From: FruitieX Date: Sun, 5 Dec 2010 23:39:15 +0200 Subject: [PATCH] This seems to fix team modes in campaign. Yay. --- qcsrc/server/bot/bot.qc | 3 ++- qcsrc/server/teamplay.qc | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/bot/bot.qc b/qcsrc/server/bot/bot.qc index 581e3f0c7..e237160a2 100644 --- a/qcsrc/server/bot/bot.qc +++ b/qcsrc/server/bot/bot.qc @@ -173,7 +173,8 @@ void bot_setnameandstuff() if(argv(4) != "" && stof(argv(4)) >= 0) bot_pants = argv(4); else bot_pants = ftos(floor(random() * 15)); - self.bot_forced_team = stof(argv(5)); + if(!autocvar_g_campaign) // no forced teams in campaign + self.bot_forced_team = stof(argv(5)); prio = 6; diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index d47115e8f..fa02ea24b 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -842,6 +842,13 @@ float FindSmallestTeam(entity pl, float ignore_pl) // c1...c4 now have counts of each team // figure out which is smallest, giving priority to the team the player is already on as a tie-breaker + if(autocvar_g_campaign) + { + entity e; + FOR_EACH_REALCLIENT(e) + if(e.team != COLOR_TEAM1) // player is forced to the red team in campaign + ++c1; // player will join the red team, join bots accordingly + } // 2 gives priority to what team you're already on, 1 goes in order // 2 doesn't seem to work though... balance_type = 1; -- 2.39.2