X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fmiscfunctions.qc;h=8b674e7826c2ccd6529e46a703d55ee00a21a2ae;hb=c637eb516648b51ef055d53244194805f53c3190;hp=2c2fc56df0983219934ebbdd062dda2ca767fc6e;hpb=b56d8435ab6710d101761c6c2b9746e38e3cc813;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/miscfunctions.qc b/qcsrc/client/miscfunctions.qc index 2c2fc56df..8b674e782 100644 --- a/qcsrc/client/miscfunctions.qc +++ b/qcsrc/client/miscfunctions.qc @@ -1,5 +1,6 @@ entity players; entity teams; +var float team_count; // real teams void AuditLists() { @@ -81,6 +82,8 @@ float RegisterTeam(entity Team) if(teams.sort_next) teams.sort_next.sort_prev = Team; teams.sort_next = Team; + if(Team.team && Team.team != NUM_SPECTATOR) + ++team_count; AuditLists(); return true; } @@ -101,6 +104,8 @@ void RemoveTeam(entity Team) parent.sort_next = Team.sort_next; if(Team.sort_next) Team.sort_next.sort_prev = parent; + if(Team.team && Team.team != NUM_SPECTATOR) + --team_count; AuditLists(); } @@ -573,6 +578,31 @@ vector getplayerorigin(float pl) return GETPLAYERORIGIN_ERROR; } +float getplayeralpha(float pl) +{ + entity e; + + e = CSQCModel_server2csqc(pl + 1); + if(e) + return e.alpha; + + return 1; +} + +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; @@ -601,7 +631,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)); + printf("Received HTTP request data for an invalid id %d.\n", id); } }