mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-19 15:30:50 +00:00
Rename nq's cl.scores to cl.players.
This commit is contained in:
parent
d514d4e465
commit
13677bc5d3
5 changed files with 24 additions and 22 deletions
|
@ -221,8 +221,8 @@ typedef struct {
|
||||||
|
|
||||||
int cdtrack; // cd audio
|
int cdtrack; // cd audio
|
||||||
|
|
||||||
// frag scoreboard
|
// all player information
|
||||||
player_info_t *scores; // [cl.maxclients]
|
player_info_t *players;
|
||||||
|
|
||||||
lightstyle_t lightstyle[MAX_LIGHTSTYLES];
|
lightstyle_t lightstyle[MAX_LIGHTSTYLES];
|
||||||
} client_state_t;
|
} client_state_t;
|
||||||
|
|
|
@ -356,8 +356,8 @@ CL_RelinkEntities (void)
|
||||||
ent->skinnum = new->skinnum;
|
ent->skinnum = new->skinnum;
|
||||||
if (i <= cl.maxclients) {
|
if (i <= cl.maxclients) {
|
||||||
ent->skin = mod_funcs->Skin_SetColormap (ent->skin, i);
|
ent->skin = mod_funcs->Skin_SetColormap (ent->skin, i);
|
||||||
mod_funcs->Skin_SetTranslation (i, cl.scores[i - 1].topcolor,
|
mod_funcs->Skin_SetTranslation (i, cl.players[i - 1].topcolor,
|
||||||
cl.scores[i - 1].bottomcolor);
|
cl.players[i - 1].bottomcolor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ent->scale = new->scale / 16.0;
|
ent->scale = new->scale / 16.0;
|
||||||
|
|
|
@ -201,11 +201,11 @@ CL_ClearState (void)
|
||||||
if (cl.edicts)
|
if (cl.edicts)
|
||||||
PL_Free (cl.edicts);
|
PL_Free (cl.edicts);
|
||||||
|
|
||||||
if (cl.scores) {
|
if (cl.players) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < cl.maxclients; 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
|
// wipe the entire cl structure
|
||||||
|
|
|
@ -359,12 +359,13 @@ CL_ParseServerInfo (void)
|
||||||
Sys_Printf ("Bad maxclients (%u) from server\n", cl.maxclients);
|
Sys_Printf ("Bad maxclients (%u) from server\n", cl.maxclients);
|
||||||
goto done;
|
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++) {
|
for (i = 0; i < cl.maxclients; i++) {
|
||||||
cl.scores[i].userinfo = Info_ParseString ("name\\", 0, 0);
|
cl.players[i].userinfo = Info_ParseString ("name\\", 0, 0);
|
||||||
cl.scores[i].name = Info_Key (cl.scores[i].userinfo, "name");
|
cl.players[i].name = Info_Key (cl.players[i].userinfo, "name");
|
||||||
cl.scores[i].topcolor = 0;
|
cl.players[i].topcolor = 0;
|
||||||
cl.scores[i].bottomcolor = 0;
|
cl.players[i].bottomcolor = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// parse gametype
|
// parse gametype
|
||||||
|
@ -983,7 +984,7 @@ CL_ParseServerMessage (void)
|
||||||
if (i >= cl.maxclients)
|
if (i >= cl.maxclients)
|
||||||
Host_Error ("CL_ParseServerMessage: svc_updatename > "
|
Host_Error ("CL_ParseServerMessage: svc_updatename > "
|
||||||
"MAX_SCOREBOARD");
|
"MAX_SCOREBOARD");
|
||||||
Info_SetValueForKey (cl.scores[i].userinfo, "name",
|
Info_SetValueForKey (cl.players[i].userinfo, "name",
|
||||||
MSG_ReadString (net_message), 0);
|
MSG_ReadString (net_message), 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -993,7 +994,7 @@ CL_ParseServerMessage (void)
|
||||||
if (i >= cl.maxclients)
|
if (i >= cl.maxclients)
|
||||||
Host_Error ("CL_ParseServerMessage: svc_updatefrags > "
|
Host_Error ("CL_ParseServerMessage: svc_updatefrags > "
|
||||||
"MAX_SCOREBOARD");
|
"MAX_SCOREBOARD");
|
||||||
cl.scores[i].frags = (short) MSG_ReadShort (net_message);
|
cl.players[i].frags = (short) MSG_ReadShort (net_message);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case svc_clientdata:
|
case svc_clientdata:
|
||||||
|
@ -1016,11 +1017,11 @@ CL_ParseServerMessage (void)
|
||||||
byte col = MSG_ReadByte (net_message);
|
byte col = MSG_ReadByte (net_message);
|
||||||
byte top = col >> 4;
|
byte top = col >> 4;
|
||||||
byte bot = col & 0xf;
|
byte bot = col & 0xf;
|
||||||
if (top != cl.scores[i].topcolor
|
if (top != cl.players[i].topcolor
|
||||||
|| bot != cl.scores[i].bottomcolor)
|
|| bot != cl.players[i].bottomcolor)
|
||||||
mod_funcs->Skin_SetTranslation (i + 1, top, bot);
|
mod_funcs->Skin_SetTranslation (i + 1, top, bot);
|
||||||
cl.scores[i].topcolor = top;
|
cl.players[i].topcolor = top;
|
||||||
cl.scores[i].bottomcolor = bot;
|
cl.players[i].bottomcolor = bot;
|
||||||
ent->skin = mod_funcs->Skin_SetColormap (ent->skin, i + 1);
|
ent->skin = mod_funcs->Skin_SetColormap (ent->skin, i + 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -519,7 +519,7 @@ Sbar_SortFrags (void)
|
||||||
// sort by frags
|
// sort by frags
|
||||||
scoreboardlines = 0;
|
scoreboardlines = 0;
|
||||||
for (i = 0; i < cl.maxclients; i++) {
|
for (i = 0; i < cl.maxclients; i++) {
|
||||||
if (cl.scores[i].name->value[0]) {
|
if (cl.players[i].name->value[0]) {
|
||||||
fragsort[scoreboardlines] = i;
|
fragsort[scoreboardlines] = i;
|
||||||
scoreboardlines++;
|
scoreboardlines++;
|
||||||
}
|
}
|
||||||
|
@ -527,7 +527,8 @@ Sbar_SortFrags (void)
|
||||||
|
|
||||||
for (i = 0; i < scoreboardlines; i++) {
|
for (i = 0; i < scoreboardlines; i++) {
|
||||||
for (j = 0; j < (scoreboardlines - 1 - i); j++) {
|
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];
|
k = fragsort[j];
|
||||||
fragsort[j] = fragsort[j + 1];
|
fragsort[j] = fragsort[j + 1];
|
||||||
fragsort[j + 1] = k;
|
fragsort[j + 1] = k;
|
||||||
|
@ -588,7 +589,7 @@ draw_frags (view_t *view)
|
||||||
|
|
||||||
for (i = 0; i < l; i++) {
|
for (i = 0; i < l; i++) {
|
||||||
k = fragsort[i];
|
k = fragsort[i];
|
||||||
s = &cl.scores[k];
|
s = &cl.players[k];
|
||||||
if (!s->name->value[0])
|
if (!s->name->value[0])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -804,7 +805,7 @@ draw_rogue_face (view_t *view)
|
||||||
|
|
||||||
// PGM 01/19/97 - team color drawing
|
// PGM 01/19/97 - team color drawing
|
||||||
|
|
||||||
s = &cl.scores[cl.viewentity - 1];
|
s = &cl.players[cl.viewentity - 1];
|
||||||
|
|
||||||
top = Sbar_ColorForMap (s->topcolor);
|
top = Sbar_ColorForMap (s->topcolor);
|
||||||
bottom = Sbar_ColorForMap (s->bottomcolor);
|
bottom = Sbar_ColorForMap (s->bottomcolor);
|
||||||
|
@ -1049,7 +1050,7 @@ Sbar_DeathmatchOverlay (view_t *view)
|
||||||
y = 40;
|
y = 40;
|
||||||
for (i = 0; i < l; i++) {
|
for (i = 0; i < l; i++) {
|
||||||
k = fragsort[i];
|
k = fragsort[i];
|
||||||
s = &cl.scores[k];
|
s = &cl.players[k];
|
||||||
if (!s->name->value[0])
|
if (!s->name->value[0])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue