X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fclient%2Fmiscfunctions.qc;h=8b674e7826c2ccd6529e46a703d55ee00a21a2ae;hb=40446bc724449798458a701c5311b9dba1ea161f;hp=48aa85f24ee242da30e8c15deaeed8688f408cd6;hpb=df2cf141547e4df971d310e2e09bbf1e8d008963;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/miscfunctions.qc b/qcsrc/client/miscfunctions.qc index 48aa85f24..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(); } @@ -581,11 +586,21 @@ float getplayeralpha(float pl) if(e) return e.alpha; - e = entcs_receiver[pl]; + return 1; +} + +vector getcsqcplayercolor(float pl) +{ + entity e; + + e = CSQCModel_server2csqc(pl); if(e) - return e.alpha; + { + if(e.colormap > 0) + return colormapPaletteColor(((e.colormap >= 1024) ? e.colormap : stof(getplayerkeyvalue(e.colormap - 1, "colors"))) & 0x0F, TRUE); + } - return 1; + return '1 1 1'; } float getplayerisdead(float pl) @@ -616,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); } }