Rename nq's cl.scores to cl.players.

This commit is contained in:
Bill Currie 2013-02-02 16:54:05 +09:00
parent d514d4e465
commit 13677bc5d3
5 changed files with 24 additions and 22 deletions

View file

@ -221,8 +221,8 @@ typedef struct {
int cdtrack; // cd audio
// frag scoreboard
player_info_t *scores; // [cl.maxclients]
// all player information
player_info_t *players;
lightstyle_t lightstyle[MAX_LIGHTSTYLES];
} client_state_t;

View file

@ -356,8 +356,8 @@ CL_RelinkEntities (void)
ent->skinnum = new->skinnum;
if (i <= cl.maxclients) {
ent->skin = mod_funcs->Skin_SetColormap (ent->skin, i);
mod_funcs->Skin_SetTranslation (i, cl.scores[i - 1].topcolor,
cl.scores[i - 1].bottomcolor);
mod_funcs->Skin_SetTranslation (i, cl.players[i - 1].topcolor,
cl.players[i - 1].bottomcolor);
}
}
ent->scale = new->scale / 16.0;

View file

@ -201,11 +201,11 @@ CL_ClearState (void)
if (cl.edicts)
PL_Free (cl.edicts);
if (cl.scores) {
if (cl.players) {
int i;
for (i = 0; i < cl.maxclients; i++)
Info_Destroy (cl.scores[i].userinfo);
Info_Destroy (cl.players[i].userinfo);
}
// wipe the entire cl structure

View file

@ -359,12 +359,13 @@ CL_ParseServerInfo (void)
Sys_Printf ("Bad maxclients (%u) from server\n", cl.maxclients);
goto done;
}
cl.scores = Hunk_AllocName (cl.maxclients * sizeof (*cl.scores), "scores");
cl.players = Hunk_AllocName (cl.maxclients * sizeof (*cl.players),
"players");
for (i = 0; i < cl.maxclients; i++) {
cl.scores[i].userinfo = Info_ParseString ("name\\", 0, 0);
cl.scores[i].name = Info_Key (cl.scores[i].userinfo, "name");
cl.scores[i].topcolor = 0;
cl.scores[i].bottomcolor = 0;
cl.players[i].userinfo = Info_ParseString ("name\\", 0, 0);
cl.players[i].name = Info_Key (cl.players[i].userinfo, "name");
cl.players[i].topcolor = 0;
cl.players[i].bottomcolor = 0;
}
// parse gametype
@ -983,7 +984,7 @@ CL_ParseServerMessage (void)
if (i >= cl.maxclients)
Host_Error ("CL_ParseServerMessage: svc_updatename > "
"MAX_SCOREBOARD");
Info_SetValueForKey (cl.scores[i].userinfo, "name",
Info_SetValueForKey (cl.players[i].userinfo, "name",
MSG_ReadString (net_message), 0);
break;
@ -993,7 +994,7 @@ CL_ParseServerMessage (void)
if (i >= cl.maxclients)
Host_Error ("CL_ParseServerMessage: svc_updatefrags > "
"MAX_SCOREBOARD");
cl.scores[i].frags = (short) MSG_ReadShort (net_message);
cl.players[i].frags = (short) MSG_ReadShort (net_message);
break;
case svc_clientdata:
@ -1016,11 +1017,11 @@ CL_ParseServerMessage (void)
byte col = MSG_ReadByte (net_message);
byte top = col >> 4;
byte bot = col & 0xf;
if (top != cl.scores[i].topcolor
|| bot != cl.scores[i].bottomcolor)
if (top != cl.players[i].topcolor
|| bot != cl.players[i].bottomcolor)
mod_funcs->Skin_SetTranslation (i + 1, top, bot);
cl.scores[i].topcolor = top;
cl.scores[i].bottomcolor = bot;
cl.players[i].topcolor = top;
cl.players[i].bottomcolor = bot;
ent->skin = mod_funcs->Skin_SetColormap (ent->skin, i + 1);
}
break;

View file

@ -519,7 +519,7 @@ Sbar_SortFrags (void)
// sort by frags
scoreboardlines = 0;
for (i = 0; i < cl.maxclients; i++) {
if (cl.scores[i].name->value[0]) {
if (cl.players[i].name->value[0]) {
fragsort[scoreboardlines] = i;
scoreboardlines++;
}
@ -527,7 +527,8 @@ Sbar_SortFrags (void)
for (i = 0; i < scoreboardlines; i++) {
for (j = 0; j < (scoreboardlines - 1 - i); j++) {
if (cl.scores[fragsort[j]].frags < cl.scores[fragsort[j + 1]].frags) {
if (cl.players[fragsort[j]].frags
< cl.players[fragsort[j + 1]].frags) {
k = fragsort[j];
fragsort[j] = fragsort[j + 1];
fragsort[j + 1] = k;
@ -588,7 +589,7 @@ draw_frags (view_t *view)
for (i = 0; i < l; i++) {
k = fragsort[i];
s = &cl.scores[k];
s = &cl.players[k];
if (!s->name->value[0])
continue;
@ -804,7 +805,7 @@ draw_rogue_face (view_t *view)
// PGM 01/19/97 - team color drawing
s = &cl.scores[cl.viewentity - 1];
s = &cl.players[cl.viewentity - 1];
top = Sbar_ColorForMap (s->topcolor);
bottom = Sbar_ColorForMap (s->bottomcolor);
@ -1049,7 +1050,7 @@ Sbar_DeathmatchOverlay (view_t *view)
y = 40;
for (i = 0; i < l; i++) {
k = fragsort[i];
s = &cl.scores[k];
s = &cl.players[k];
if (!s->name->value[0])
continue;