]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Scoreboard: remove team 0
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 11 Dec 2015 09:59:30 +0000 (20:59 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Fri, 11 Dec 2015 09:59:30 +0000 (20:59 +1100)
Closes #1584 and #1597

qcsrc/client/main.qc
qcsrc/client/scoreboard.qc
qcsrc/common/ent_cs.qh

index c6529a070e67920e8648b0ffe04e745c7e011e05..576b2485c5e1ced62fea02d1cf5777f6fa9c3644 100644 (file)
@@ -271,7 +271,8 @@ void Playerchecker_Think()
                                e.ping_packetloss = 0;
                                e.ping_movementloss = 0;
                                //e.gotscores = 0; // we might already have the scores...
-                               SetTeam(e, entcs_GetTeam(i)); // will not hurt; later updates come with HUD_UpdatePlayerTeams
+                               int t = entcs_GetScoreTeam(i);
+                               if (t) SetTeam(e, t); // will not hurt; later updates come with HUD_UpdatePlayerTeams
                                RegisterPlayer(e);
                                HUD_UpdatePlayerPos(e);
                        }
index 06c7363afecc101cfd76d0d983990b22051d352b..6ef89bf4d0343c92890e42676fb6cf0d15abc69b 100644 (file)
@@ -109,7 +109,7 @@ void HUD_UpdatePlayerTeams()
        for(pl = players.sort_next; pl; pl = pl.sort_next)
        {
                num += 1;
-               Team = entcs_GetTeam(pl.sv_entnum);
+               Team = entcs_GetScoreTeam(pl.sv_entnum);
                if(SetTeam(pl, Team))
                {
                        tmp = pl.sort_prev;
index 8122ccdc0ee543ad913594b6384c697efe665971..e8d568af5e6d9bb833c84c5fbb17ebd9808ac24f 100644 (file)
@@ -82,6 +82,16 @@ REGISTER_NET_TEMP(CLIENT_ENTCS)
                return entcs_IsSpectating(i) ? NUM_SPECTATOR : entcs_GetTeamColor(i);
        }
 
+       /**
+        * Same as `entcs_GetTeam`, but returns -1 for no team
+        */
+       int entcs_GetScoreTeam(int i)
+       {
+               int t = entcs_GetTeam(i);
+               if (!t) t = -1;
+               return t;
+       }
+
        /**
        * @param i zero indexed player
        */