]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/miscfunctions.qc
Merge remote-tracking branch 'origin/master' into samual/weapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / miscfunctions.qc
index 7edabdfc524bbcc5fecc5636d936e5bac72f0343..81b8def2796208cf3bb1c1bd57a0c054bf02db71 100644 (file)
@@ -108,7 +108,7 @@ entity GetTeam(float Team, float add)
 {
        float num;
        entity tm;
-       num = (Team == COLOR_SPECTATOR) ? 16 : Team;
+       num = (Team == NUM_SPECTATOR) ? 16 : Team;
        if(teamslots[num])
                return teamslots[num];
        if not(add)
@@ -164,20 +164,6 @@ string ColorTranslateRGB(string s)
                return s;
 }
 
-string Team_ColorCode(float teamid)
-{
-    if (teamid == COLOR_TEAM1)
-        return "^1";
-    else if (teamid == COLOR_TEAM2)
-        return "^4";
-    else if (teamid == COLOR_TEAM3)
-        return "^3";
-    else if (teamid == COLOR_TEAM4)
-        return "^6";
-    else
-        return "^7";
-}
-
 // decolorizes and team colors the player name when needed
 string playername(string thename, float teamid)
 {
@@ -587,6 +573,20 @@ vector getplayerorigin(float pl)
        return GETPLAYERORIGIN_ERROR;
 }
 
+vector getcsqcplayercolor(float pl)
+{
+       entity e;
+       
+       e = CSQCModel_server2csqc(pl);
+       if(e)
+       {
+               if(e.colormap > 0)
+                       return colormapPaletteColor(((e.colormap >= 1024) ? e.colormap : stof(getplayerkeyvalue(e.colormap - 1, "colors"))) & 0x0F, TRUE);
+       }
+       
+       return '1 1 1';
+}
+
 float getplayerisdead(float pl)
 {
        entity e;
@@ -615,7 +615,7 @@ void URI_Get_Callback(float id, float status, string data)
        }
        else
        {
-               print(sprintf(_("Received HTTP request data for an invalid id %d.\n"), id));
+               print(sprintf("Received HTTP request data for an invalid id %d.\n", id));
        }
 }