cl.items in nq is now cl.stats[ITEMS] as per qw

This commit is contained in:
Bill Currie 2001-05-15 17:22:53 +00:00
parent 9c9e22f253
commit 40cbc5ed3c
9 changed files with 53 additions and 53 deletions

View file

@ -158,7 +158,6 @@ typedef struct
// information for local display // information for local display
int stats[MAX_CL_STATS]; // health, etc int stats[MAX_CL_STATS]; // health, etc
int items; // inventory bit flags
float item_gettime[32]; // cl.time of aquiring item, for blinking float item_gettime[32]; // cl.time of aquiring item, for blinking
float faceanimtime; // use anim frame if cl.time < this float faceanimtime; // use anim frame if cl.time < this

View file

@ -88,6 +88,7 @@
#define STAT_TOTALMONSTERS 12 #define STAT_TOTALMONSTERS 12
#define STAT_SECRETS 13 // bumped on client side by svc_foundsecret #define STAT_SECRETS 13 // bumped on client side by svc_foundsecret
#define STAT_MONSTERS 14 // bumped by svc_killedmonster #define STAT_MONSTERS 14 // bumped by svc_killedmonster
#define STAT_ITEMS 15
// stock defines // stock defines

View file

@ -527,12 +527,12 @@ CL_ParseClientdata (int bits)
// [always sent] if (bits & SU_ITEMS) // [always sent] if (bits & SU_ITEMS)
i = MSG_ReadLong (net_message); i = MSG_ReadLong (net_message);
if (cl.items != i) { // set flash times if (cl.stats[STAT_ITEMS] != i) { // set flash times
Sbar_Changed (); Sbar_Changed ();
for (j = 0; j < 32; j++) for (j = 0; j < 32; j++)
if ((i & (1 << j)) && !(cl.items & (1 << j))) if ((i & (1 << j)) && !(cl.stats[STAT_ITEMS] & (1 << j)))
cl.item_gettime[j] = cl.time; cl.item_gettime[j] = cl.time;
cl.items = i; cl.stats[STAT_ITEMS] = i;
} }
cl.onground = (bits & SU_ONGROUND) != 0; cl.onground = (bits & SU_ONGROUND) != 0;

View file

@ -857,7 +857,7 @@ R_DrawViewModel (void)
if (!r_drawviewmodel->int_val || chase_active->int_val if (!r_drawviewmodel->int_val || chase_active->int_val
|| envmap || envmap
|| !r_drawentities->int_val || !r_drawentities->int_val
|| (cl.items & IT_INVISIBILITY) || (cl.stats[STAT_ITEMS] & IT_INVISIBILITY)
|| cl.stats[STAT_HEALTH] <= 0 || !currententity->model) || cl.stats[STAT_HEALTH] <= 0 || !currententity->model)
return; return;

View file

@ -126,32 +126,32 @@ V_CalcPowerupCshift (void)
if ((gl_dlight_polyblend->int_val || if ((gl_dlight_polyblend->int_val ||
!(gl_dlight_lightmap->int_val && gl_dlight_polyblend->int_val)) && !(gl_dlight_lightmap->int_val && gl_dlight_polyblend->int_val)) &&
(cl.items & IT_INVULNERABILITY || (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY ||
cl.items & IT_QUAD)) cl.stats[STAT_ITEMS] & IT_QUAD))
{ {
if (cl.items & IT_INVULNERABILITY && if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY &&
cl.items & IT_QUAD) { cl.stats[STAT_ITEMS] & IT_QUAD) {
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 255;
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 0;
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255;
cl.cshifts[CSHIFT_POWERUP].percent = 30; cl.cshifts[CSHIFT_POWERUP].percent = 30;
} else if (cl.items & IT_QUAD) { } else if (cl.stats[STAT_ITEMS] & IT_QUAD) {
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 0;
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 0;
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255;
cl.cshifts[CSHIFT_POWERUP].percent = 30; cl.cshifts[CSHIFT_POWERUP].percent = 30;
} else if (cl.items & IT_INVULNERABILITY) { } else if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY) {
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 255;
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 255;
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0;
cl.cshifts[CSHIFT_POWERUP].percent = 30; cl.cshifts[CSHIFT_POWERUP].percent = 30;
} }
} else if (cl.items & IT_SUIT) { } else if (cl.stats[STAT_ITEMS] & IT_SUIT) {
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 0;
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 255;
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0;
cl.cshifts[CSHIFT_POWERUP].percent = 20; cl.cshifts[CSHIFT_POWERUP].percent = 20;
} else if (cl.items & IT_INVISIBILITY) { } else if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY) {
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 100; cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 100;
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 100; cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 100;
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 100; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 100;

View file

@ -423,7 +423,7 @@ Sbar_DrawInventory (void)
// weapons // weapons
for (i = 0; i < 7; i++) { for (i = 0; i < 7; i++) {
if (cl.items & (IT_SHOTGUN << i)) { if (cl.stats[STAT_ITEMS] & (IT_SHOTGUN << i)) {
time = cl.item_gettime[i]; time = cl.item_gettime[i];
flashon = (int) ((cl.time - time) * 10); flashon = (int) ((cl.time - time) * 10);
flashon = max (0, flashon); flashon = max (0, flashon);
@ -457,7 +457,7 @@ Sbar_DrawInventory (void)
// int grenadeflashing = 0; // int grenadeflashing = 0;
// //
// for (i = 0; i < 4; i++) { // for (i = 0; i < 4; i++) {
// if (cl.items & (1 << hipweapons[i])) { // if (cl.stats[STAT_ITEMS] & (1 << hipweapons[i])) {
// time = cl.item_gettime[hipweapons[i]]; // time = cl.item_gettime[hipweapons[i]];
// flashon = (int) ((cl.time - time) * 10); // flashon = (int) ((cl.time - time) * 10);
// flashon = max (0, flashon); // flashon = max (0, flashon);
@ -474,7 +474,7 @@ Sbar_DrawInventory (void)
// // check grenade launcher // // check grenade launcher
// switch (i) { // switch (i) {
// case 2: // case 2:
// if (cl.items & HIT_PROXIMITY_GUN) { // if (cl.stats[STAT_ITEMS] & HIT_PROXIMITY_GUN) {
// if (flashon) { // if (flashon) {
// grenadeflashing = 1; // grenadeflashing = 1;
// Sbar_DrawPic (96, -16, hsb_weapons[flashon][2]); // Sbar_DrawPic (96, -16, hsb_weapons[flashon][2]);
@ -482,7 +482,7 @@ Sbar_DrawInventory (void)
// } // }
// break; // break;
// case 3: // case 3:
// if (cl.items & (IT_SHOTGUN << 4)) { // if (cl.stats[STAT_ITEMS] & (IT_SHOTGUN << 4)) {
// if (flashon && !grenadeflashing) { // if (flashon && !grenadeflashing) {
// Sbar_DrawPic (96, -16, hsb_weapons[flashon][3]); // Sbar_DrawPic (96, -16, hsb_weapons[flashon][3]);
// } else if (!grenadeflashing) { // } else if (!grenadeflashing) {
@ -549,7 +549,7 @@ Sbar_DrawInventory (void)
// items // items
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++) {
if (cl.items & (1 << (17 + i))) { if (cl.stats[STAT_ITEMS] & (1 << (17 + i))) {
time = cl.item_gettime[17 + i]; time = cl.item_gettime[17 + i];
if (time && time > (cl.time - 2) && flashon) { // Flash frame if (time && time > (cl.time - 2) && flashon) { // Flash frame
sb_updates = 0; sb_updates = 0;
@ -568,7 +568,7 @@ Sbar_DrawInventory (void)
// // hipnotic items // // hipnotic items
// if (hipnotic) { // if (hipnotic) {
// for (i = 0; i < 2; i++) { // for (i = 0; i < 2; i++) {
// if (cl.items & (1 << (24 + i))) { // if (cl.stats[STAT_ITEMS] & (1 << (24 + i))) {
// time = cl.item_gettime[24 + i]; // time = cl.item_gettime[24 + i];
// if (time && time > cl.time - 2 && flashon) { // flash // if (time && time > cl.time - 2 && flashon) { // flash
// // frame // // frame
@ -585,7 +585,7 @@ Sbar_DrawInventory (void)
// FIXME: MISSIONHUD // FIXME: MISSIONHUD
// if (rogue) { // new rogue items // if (rogue) { // new rogue items
// for (i = 0; i < 2; i++) { // for (i = 0; i < 2; i++) {
// if (cl.items & (1 << (29 + i))) { // if (cl.stats[STAT_ITEMS] & (1 << (29 + i))) {
// time = cl.item_gettime[29 + i]; // time = cl.item_gettime[29 + i];
// //
// if (time && time > (cl.time - 2) && flashon) { // flash // if (time && time > (cl.time - 2) && flashon) { // flash
@ -602,7 +602,7 @@ Sbar_DrawInventory (void)
// } else { // } else {
// sigils // sigils
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (cl.items & (1 << (28 + i))) { if (cl.stats[STAT_ITEMS] & (1 << (28 + i))) {
time = cl.item_gettime[28 + i]; time = cl.item_gettime[28 + i];
if (time && time > cl.time - 2 && flashon) { // flash if (time && time > cl.time - 2 && flashon) { // flash
// frame // frame
@ -728,23 +728,23 @@ Sbar_DrawFace (void)
// } // }
// PGM 01/19/97 - team color drawing // PGM 01/19/97 - team color drawing
if ((cl.items & (IT_INVISIBILITY | IT_INVULNERABILITY)) if ((cl.stats[STAT_ITEMS] & (IT_INVISIBILITY | IT_INVULNERABILITY))
== (IT_INVISIBILITY | IT_INVULNERABILITY)) { == (IT_INVISIBILITY | IT_INVULNERABILITY)) {
Sbar_DrawPic (112, 0, sb_face_invis_invuln); Sbar_DrawPic (112, 0, sb_face_invis_invuln);
return; return;
} }
if (cl.items & IT_QUAD) { if (cl.stats[STAT_ITEMS] & IT_QUAD) {
Sbar_DrawPic (112, 0, sb_face_quad); Sbar_DrawPic (112, 0, sb_face_quad);
return; return;
} }
if (cl.items & IT_INVISIBILITY) { if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY) {
Sbar_DrawPic (112, 0, sb_face_invis); Sbar_DrawPic (112, 0, sb_face_invis);
return; return;
} }
if (cl.items & IT_INVULNERABILITY) { if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY) {
Sbar_DrawPic (112, 0, sb_face_invuln); Sbar_DrawPic (112, 0, sb_face_invuln);
return; return;
} }
@ -772,13 +772,13 @@ Sbar_DrawNormal (void)
// FIXME: MISSIONHUD // FIXME: MISSIONHUD
// if (hipnotic) { // if (hipnotic) {
// if (cl.items & IT_KEY1) // if (cl.stats[STAT_ITEMS] & IT_KEY1)
// Sbar_DrawPic (209, 3, sb_items[0]); // Sbar_DrawPic (209, 3, sb_items[0]);
// if (cl.items & IT_KEY2) // if (cl.stats[STAT_ITEMS] & IT_KEY2)
// Sbar_DrawPic (209, 12, sb_items[1]); // Sbar_DrawPic (209, 12, sb_items[1]);
// } // }
// armor // armor
if (cl.items & IT_INVULNERABILITY) { if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY) {
Sbar_DrawNum (24, 0, 666, 3, 1); Sbar_DrawNum (24, 0, 666, 3, 1);
Sbar_DrawPic (0, 0, draw_disc); Sbar_DrawPic (0, 0, draw_disc);
} else { } else {
@ -786,20 +786,20 @@ Sbar_DrawNormal (void)
// if (rogue) { // if (rogue) {
// Sbar_DrawNum (24, 0, cl.stats[STAT_ARMOR], 3, // Sbar_DrawNum (24, 0, cl.stats[STAT_ARMOR], 3,
// cl.stats[STAT_ARMOR] <= 25); // cl.stats[STAT_ARMOR] <= 25);
// if (cl.items & RIT_ARMOR3) // if (cl.stats[STAT_ITEMS] & RIT_ARMOR3)
// Sbar_DrawPic (0, 0, sb_armor[2]); // Sbar_DrawPic (0, 0, sb_armor[2]);
// else if (cl.items & RIT_ARMOR2) // else if (cl.stats[STAT_ITEMS] & RIT_ARMOR2)
// Sbar_DrawPic (0, 0, sb_armor[1]); // Sbar_DrawPic (0, 0, sb_armor[1]);
// else if (cl.items & RIT_ARMOR1) // else if (cl.stats[STAT_ITEMS] & RIT_ARMOR1)
// Sbar_DrawPic (0, 0, sb_armor[0]); // Sbar_DrawPic (0, 0, sb_armor[0]);
// } else { // } else {
Sbar_DrawNum (24, 0, cl.stats[STAT_ARMOR], 3, Sbar_DrawNum (24, 0, cl.stats[STAT_ARMOR], 3,
cl.stats[STAT_ARMOR] <= 25); cl.stats[STAT_ARMOR] <= 25);
if (cl.items & IT_ARMOR3) if (cl.stats[STAT_ITEMS] & IT_ARMOR3)
Sbar_DrawPic (0, 0, sb_armor[2]); Sbar_DrawPic (0, 0, sb_armor[2]);
else if (cl.items & IT_ARMOR2) else if (cl.stats[STAT_ITEMS] & IT_ARMOR2)
Sbar_DrawPic (0, 0, sb_armor[1]); Sbar_DrawPic (0, 0, sb_armor[1]);
else if (cl.items & IT_ARMOR1) else if (cl.stats[STAT_ITEMS] & IT_ARMOR1)
Sbar_DrawPic (0, 0, sb_armor[0]); Sbar_DrawPic (0, 0, sb_armor[0]);
// } // }
} }
@ -814,28 +814,28 @@ Sbar_DrawNormal (void)
// FIXME: MISSIONHUD // FIXME: MISSIONHUD
// // ammo icon // // ammo icon
// if (rogue) { // if (rogue) {
// if (cl.items & RIT_SHELLS) // if (cl.stats[STAT_ITEMS] & RIT_SHELLS)
// Sbar_DrawPic (224, 0, sb_ammo[0]); // Sbar_DrawPic (224, 0, sb_ammo[0]);
// else if (cl.items & RIT_NAILS) // else if (cl.stats[STAT_ITEMS] & RIT_NAILS)
// Sbar_DrawPic (224, 0, sb_ammo[1]); // Sbar_DrawPic (224, 0, sb_ammo[1]);
// else if (cl.items & RIT_ROCKETS) // else if (cl.stats[STAT_ITEMS] & RIT_ROCKETS)
// Sbar_DrawPic (224, 0, sb_ammo[2]); // Sbar_DrawPic (224, 0, sb_ammo[2]);
// else if (cl.items & RIT_CELLS) // else if (cl.stats[STAT_ITEMS] & RIT_CELLS)
// Sbar_DrawPic (224, 0, sb_ammo[3]); // Sbar_DrawPic (224, 0, sb_ammo[3]);
// else if (cl.items & RIT_LAVA_NAILS) // else if (cl.stats[STAT_ITEMS] & RIT_LAVA_NAILS)
// Sbar_DrawPic (224, 0, rsb_ammo[0]); // Sbar_DrawPic (224, 0, rsb_ammo[0]);
// else if (cl.items & RIT_PLASMA_AMMO) // else if (cl.stats[STAT_ITEMS] & RIT_PLASMA_AMMO)
// Sbar_DrawPic (224, 0, rsb_ammo[1]); // Sbar_DrawPic (224, 0, rsb_ammo[1]);
// else if (cl.items & RIT_MULTI_ROCKETS) // else if (cl.stats[STAT_ITEMS] & RIT_MULTI_ROCKETS)
// Sbar_DrawPic (224, 0, rsb_ammo[2]); // Sbar_DrawPic (224, 0, rsb_ammo[2]);
// } else { // } else {
if (cl.items & IT_SHELLS) if (cl.stats[STAT_ITEMS] & IT_SHELLS)
Sbar_DrawPic (224, 0, sb_ammo[0]); Sbar_DrawPic (224, 0, sb_ammo[0]);
else if (cl.items & IT_NAILS) else if (cl.stats[STAT_ITEMS] & IT_NAILS)
Sbar_DrawPic (224, 0, sb_ammo[1]); Sbar_DrawPic (224, 0, sb_ammo[1]);
else if (cl.items & IT_ROCKETS) else if (cl.stats[STAT_ITEMS] & IT_ROCKETS)
Sbar_DrawPic (224, 0, sb_ammo[2]); Sbar_DrawPic (224, 0, sb_ammo[2]);
else if (cl.items & IT_CELLS) else if (cl.stats[STAT_ITEMS] & IT_CELLS)
Sbar_DrawPic (224, 0, sb_ammo[3]); Sbar_DrawPic (224, 0, sb_ammo[3]);
// } // }
Sbar_DrawNum (248, 0, cl.stats[STAT_AMMO], 3, cl.stats[STAT_AMMO] <= 10); Sbar_DrawNum (248, 0, cl.stats[STAT_AMMO], 3, cl.stats[STAT_AMMO] <= 10);

View file

@ -636,7 +636,7 @@ R_DrawViewModel (void)
if (chase_active->int_val) if (chase_active->int_val)
return; return;
if (cl.items & IT_INVISIBILITY) if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY)
return; return;
if (cl.stats[STAT_HEALTH] <= 0) if (cl.stats[STAT_HEALTH] <= 0)

View file

@ -49,28 +49,28 @@ V_CalcPowerupCshift (void)
if (!cl_cshift_powerup->int_val) if (!cl_cshift_powerup->int_val)
return; return;
if (cl.items & IT_QUAD if (cl.stats[STAT_ITEMS] & IT_QUAD
&& cl.items & IT_INVULNERABILITY) { && cl.stats[STAT_ITEMS] & IT_INVULNERABILITY) {
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 255;
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 0;
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255;
cl.cshifts[CSHIFT_POWERUP].percent = 30; cl.cshifts[CSHIFT_POWERUP].percent = 30;
} else if (cl.items & IT_QUAD) { } else if (cl.stats[STAT_ITEMS] & IT_QUAD) {
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 0;
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 0;
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255;
cl.cshifts[CSHIFT_POWERUP].percent = 30; cl.cshifts[CSHIFT_POWERUP].percent = 30;
} else if (cl.items & IT_SUIT) { } else if (cl.stats[STAT_ITEMS] & IT_SUIT) {
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 0;
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 255;
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0;
cl.cshifts[CSHIFT_POWERUP].percent = 20; cl.cshifts[CSHIFT_POWERUP].percent = 20;
} else if (cl.items & IT_INVISIBILITY) { } else if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY) {
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 100; cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 100;
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 100; cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 100;
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 100; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 100;
cl.cshifts[CSHIFT_POWERUP].percent = 100; cl.cshifts[CSHIFT_POWERUP].percent = 100;
} else if (cl.items & IT_INVULNERABILITY) { } else if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY) {
cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 255;
cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 255;
cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0;