X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fmiscfunctions.qc;h=970a681e37b202f9bfc2a49c6f2c6377b0a13715;hp=bbe0722fd7dad9464b9a8df5a3d1ceb7537d3059;hb=e9815ad279dc61506e5e65c34348fa7dcc570b9e;hpb=892550d1f8d9e76649b118ff54255c033de6d8b0 diff --git a/qcsrc/client/miscfunctions.qc b/qcsrc/client/miscfunctions.qc index bbe0722fd..970a681e3 100644 --- a/qcsrc/client/miscfunctions.qc +++ b/qcsrc/client/miscfunctions.qc @@ -2,11 +2,11 @@ #include "hud/all.qh" -#include "../common/command/generic.qh" +#include -#include "../common/teams.qh" +#include -#include "../lib/csqcmodel/cl_model.qh" +#include void AuditLists() @@ -79,6 +79,7 @@ void MoveToLast(entity e) float RegisterTeam(entity Team) { + assert_once(Team.team, eprint(Team)); entity tm; AuditLists(); for(tm = teams.sort_next; tm; tm = tm.sort_next) @@ -118,13 +119,13 @@ void RemoveTeam(entity Team) entity GetTeam(int Team, bool add) { + TC(int, Team); TC(bool, add); int num = (Team == NUM_SPECTATOR) ? 16 : Team; if(teamslots[num]) return teamslots[num]; if (!add) return world; - entity tm = new(team); - make_pure(tm); + entity tm = new_pure(team); tm.team = Team; teamslots[num] = tm; RegisterTeam(tm); @@ -159,6 +160,7 @@ float PreviewExists(string name) // decolorizes and team colors the player name when needed string playername(string thename, float teamid) { + TC(int, teamid); string t; if (teamplay) { @@ -482,30 +484,10 @@ void DrawCircleClippedPic(vector centre, float radi, string pic, float f, vector } } -// TODO: entcs -float getplayeralpha(int pl) -{ - entity e = CSQCModel_server2csqc(pl + 1); - return (e) ? e.alpha : 1; -} - -// TODO: entcs -vector getcsqcplayercolor(int pl) -{ - entity e = CSQCModel_server2csqc(pl); - return (e && e.colormap > 0) ? colormapPaletteColor(((e.colormap >= 1024) ? e.colormap : stof(getplayerkeyvalue(e.colormap - 1, "colors"))) & 0x0F, true) : '1 1 1'; -} - -// TODO: entcs -bool getplayerisdead(int pl) -{ - entity e = CSQCModel_server2csqc(pl + 1); - return e ? e.csqcmodel_isdead : false; -} - /** engine callback */ -void URI_Get_Callback(int id, float status, string data) +void URI_Get_Callback(int id, int status, string data) { + TC(int, id); TC(int, status); if(url_URI_Get_Callback(id, status, data)) { // handled