]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/teamplay.qc
Merge branch 'master' into Mario/ons_updates
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / teamplay.qc
index cecc624b861f2ac0c08fbb9a779c794da7743cec..f2d88aa77c9535f5735db54336291c2f5b53a0cb 100644 (file)
@@ -1,20 +1,10 @@
-string cache_mutatormsg;
-string cache_lastmutatormsg;
-
-// client counts for each team
-float c1, c2, c3, c4;
-// # of bots on those teams
-float cb1, cb2, cb3, cb4;
-
-//float audit_teams_time;
+#include "teamplay.qh"
 
 void TeamchangeFrags(entity e)
 {
        PlayerScore_Clear(e);
 }
 
-void entcs_init();
-
 void LogTeamchange(float player_id, float team_number, float type)
 {
        if(!autocvar_sv_eventlog)
@@ -596,11 +586,11 @@ float TeamSmallerEqThanTeam(float ta, float tb, entity e)
 
        // invalid
        if(ca < 0 || cb < 0)
-               return FALSE;
+               return false;
 
        // equal
        if(ta == tb)
-               return TRUE;
+               return true;
 
        if(IS_REAL_CLIENT(e))
        {
@@ -614,10 +604,10 @@ float TeamSmallerEqThanTeam(float ta, float tb, entity e)
        // keep teams alive (teams of size 0 always count as smaller, ignoring score)
        if(ca < 1)
                if(cb >= 1)
-                       return TRUE;
+                       return true;
        if(ca >= 1)
                if(cb < 1)
-                       return FALSE;
+                       return false;
 
        // first, normalize
        f = max(ca, cb, 1);
@@ -736,7 +726,7 @@ float JoinBestTeam(entity pl, float only_return_best, float forcebestteam)
                // otherwise end up on the smallest team (handled below)
        }
 
-       smallest = FindSmallestTeam(pl, TRUE);
+       smallest = FindSmallestTeam(pl, true);
 
        if(!only_return_best && !pl.bot_forced_team)
        {
@@ -813,7 +803,7 @@ void SV_ChangeTeam(float _color)
        if(scolor == dcolor)
        {
                //bprint("same team change\n");
-               SetPlayerTeam(self, dteam, steam, TRUE);
+               SetPlayerTeam(self, dteam, steam, true);
                return;
        }
 
@@ -841,7 +831,7 @@ void SV_ChangeTeam(float _color)
                TeamchangeFrags(self);
        }
 
-       SetPlayerTeam(self, dteam, steam, FALSE);
+       SetPlayerTeam(self, dteam, steam, false);
 
        if(IS_PLAYER(self) && steam != dteam)
        {
@@ -985,7 +975,7 @@ void ShufflePlayerOutOfTeam (float source_team)
 
        // move the player to the new team
        TeamchangeFrags(selected);
-       SetPlayerTeam(selected, smallestteam, source_team, FALSE);
+       SetPlayerTeam(selected, smallestteam, source_team, false);
 
        if(selected.deadflag == DEAD_NO)
                Damage(selected, selected, selected, 100000, DEATH_AUTOTEAMCHANGE, selected.origin, '0 0 0');