]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
JoinBestTeam improvement.
authorLyberta <lyberta@lyberta.net>
Sun, 6 Aug 2017 02:18:06 +0000 (05:18 +0300)
committerLyberta <lyberta@lyberta.net>
Sun, 6 Aug 2017 02:18:06 +0000 (05:18 +0300)
qcsrc/server/teamplay.qc

index 92cd8ebccedede1cfabe53bbb3211cb31df71890..dfa9b89f996a04ab398dcd020c4eb412fdffa8aa 100644 (file)
@@ -851,12 +851,11 @@ int JoinBestTeam(entity this, bool only_return_best, bool force_best_team)
        // find out what teams are available
        CheckAllowedTeams(this);
 
-       int selected_team;
-
        // if we don't care what team he ends up on, put him on whatever team he entered as.
        // if he's not on a valid team, then let other code put him on the smallest team
        if (!force_best_team)
        {
+               int selected_team;
                if(     c1 >= 0 && this.team == NUM_TEAM_1)
                        selected_team = this.team;
                else if(c2 >= 0 && this.team == NUM_TEAM_2)