From 21b376cca79df62d17d395c7f912ef13be05fcbf Mon Sep 17 00:00:00 2001 From: Lyberta Date: Thu, 15 Jun 2017 04:01:56 +0300 Subject: [PATCH] Survival: Switched to new FindBestTeams event. --- .../mutators/mutator/gamemode_survival.qc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/qcsrc/server/mutators/mutator/gamemode_survival.qc b/qcsrc/server/mutators/mutator/gamemode_survival.qc index 18dd43b52..e78e9e5cf 100644 --- a/qcsrc/server/mutators/mutator/gamemode_survival.qc +++ b/qcsrc/server/mutators/mutator/gamemode_survival.qc @@ -1760,17 +1760,17 @@ MUTATOR_HOOKFUNCTION(surv, GetTeamCount, CBC_ORDER_EXCLUSIVE) return true; } -/// \brief Hook that determines the best team for the player to join. -MUTATOR_HOOKFUNCTION(surv, JoinBestTeam, CBC_ORDER_EXCLUSIVE) +/// \brief Hook that determines the best teams for the player to join. +MUTATOR_HOOKFUNCTION(surv, FindBestTeams, CBC_ORDER_EXCLUSIVE) { if (surv_type == SURVIVAL_TYPE_COOP) { - return; + return false; } entity player = M_ARGV(0, entity); if (IS_BOT_CLIENT(player)) { - return; + return false; } int numattackerhumans = surv_numattackerhumans; int numdefenderhumans = surv_numdefenderhumans; @@ -1784,15 +1784,16 @@ MUTATOR_HOOKFUNCTION(surv, JoinBestTeam, CBC_ORDER_EXCLUSIVE) } if (numattackerhumans < numdefenderhumans) { - M_ARGV(1, float) = Team_TeamToNumber(surv_attackerteam); - return; + M_ARGV(1, float) = BIT(Team_TeamToNumber(surv_attackerteam) - 1); + return true; } if (numattackerhumans > numdefenderhumans) { - M_ARGV(1, float) = Team_TeamToNumber(surv_defenderteam); - return; + M_ARGV(1, float) = BIT(Team_TeamToNumber(surv_defenderteam) - 1); + return true; } - M_ARGV(1, float) = floor(random() * 2) + 1; + M_ARGV(1, float) = SURVIVAL_TEAM_BITS; + return true; } /// \brief Hook that is called when player has changed the team. -- 2.39.5