]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/ent_cs.qh
Merge branch 'master' into terencehill/scoreboard_panel_2
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / ent_cs.qh
index 8122ccdc0ee543ad913594b6384c697efe665971..1c72b351f7ff7e4e65b48fd9e5bf599f86c11a40 100644 (file)
@@ -26,7 +26,7 @@ REGISTER_NET_TEMP(CLIENT_ENTCS)
 
        bool entcs_send(entity this, entity to, int sf);
 
-       void entcs_think();
+       void entcs_think(entity this);
 
        void entcs_attach(entity e);
 
@@ -50,7 +50,8 @@ REGISTER_NET_TEMP(CLIENT_ENTCS)
        {
                AL_DELETE(_entcs);
        }
-       #define entcs_receiver(...) EVAL(OVERLOAD(entcs_receiver, __VA_ARGS__))
+       #define entcs_receiver(...) EVAL_entcs_receiver(OVERLOAD(entcs_receiver, __VA_ARGS__))
+       #define EVAL_entcs_receiver(...) __VA_ARGS__
        #define entcs_receiver_1(i) AL_gete(_entcs, i)
        #define entcs_receiver_2(i, v) AL_sete(_entcs, i, v)
        #define entcs_is_self(e) ((e).sv_entnum == player_localentnum - 1)
@@ -82,6 +83,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 in teamplay
+        */
+       int entcs_GetScoreTeam(int i)
+       {
+               int t = entcs_GetTeam(i);
+               if (teamplay && !t) t = -1;
+               return t;
+       }
+
        /**
        * @param i zero indexed player
        */