diff --git a/nq/include/client.h b/nq/include/client.h index 77389382a..9fe6627a4 100644 --- a/nq/include/client.h +++ b/nq/include/client.h @@ -158,7 +158,6 @@ typedef struct // information for local display int stats[MAX_CL_STATS]; // health, etc - int items; // inventory bit flags float item_gettime[32]; // cl.time of aquiring item, for blinking float faceanimtime; // use anim frame if cl.time < this diff --git a/nq/include/game.h b/nq/include/game.h index 2d179f151..6ab374c57 100644 --- a/nq/include/game.h +++ b/nq/include/game.h @@ -88,6 +88,7 @@ #define STAT_TOTALMONSTERS 12 #define STAT_SECRETS 13 // bumped on client side by svc_foundsecret #define STAT_MONSTERS 14 // bumped by svc_killedmonster +#define STAT_ITEMS 15 // stock defines diff --git a/nq/source/cl_parse.c b/nq/source/cl_parse.c index e3b013b82..6dcab57eb 100644 --- a/nq/source/cl_parse.c +++ b/nq/source/cl_parse.c @@ -527,12 +527,12 @@ CL_ParseClientdata (int bits) // [always sent] if (bits & SU_ITEMS) i = MSG_ReadLong (net_message); - if (cl.items != i) { // set flash times + if (cl.stats[STAT_ITEMS] != i) { // set flash times Sbar_Changed (); 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.items = i; + cl.stats[STAT_ITEMS] = i; } cl.onground = (bits & SU_ONGROUND) != 0; diff --git a/nq/source/gl_rmain.c b/nq/source/gl_rmain.c index 330fb40e1..ba6cfe813 100644 --- a/nq/source/gl_rmain.c +++ b/nq/source/gl_rmain.c @@ -857,7 +857,7 @@ R_DrawViewModel (void) if (!r_drawviewmodel->int_val || chase_active->int_val || envmap || !r_drawentities->int_val - || (cl.items & IT_INVISIBILITY) + || (cl.stats[STAT_ITEMS] & IT_INVISIBILITY) || cl.stats[STAT_HEALTH] <= 0 || !currententity->model) return; diff --git a/nq/source/gl_view.c b/nq/source/gl_view.c index c0e674f6a..ee69ad02f 100644 --- a/nq/source/gl_view.c +++ b/nq/source/gl_view.c @@ -126,32 +126,32 @@ V_CalcPowerupCshift (void) if ((gl_dlight_polyblend->int_val || !(gl_dlight_lightmap->int_val && gl_dlight_polyblend->int_val)) && - (cl.items & IT_INVULNERABILITY || - cl.items & IT_QUAD)) + (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY || + cl.stats[STAT_ITEMS] & IT_QUAD)) { - if (cl.items & IT_INVULNERABILITY && - cl.items & IT_QUAD) { + if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY && + cl.stats[STAT_ITEMS] & IT_QUAD) { cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255; 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[1] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255; 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[1] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0; 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[1] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0; 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[1] = 100; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 100; diff --git a/nq/source/sbar.c b/nq/source/sbar.c index 19201eb48..4057bce7b 100644 --- a/nq/source/sbar.c +++ b/nq/source/sbar.c @@ -423,7 +423,7 @@ Sbar_DrawInventory (void) // weapons 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]; flashon = (int) ((cl.time - time) * 10); flashon = max (0, flashon); @@ -457,7 +457,7 @@ Sbar_DrawInventory (void) // int grenadeflashing = 0; // // 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]]; // flashon = (int) ((cl.time - time) * 10); // flashon = max (0, flashon); @@ -474,7 +474,7 @@ Sbar_DrawInventory (void) // // check grenade launcher // switch (i) { // case 2: -// if (cl.items & HIT_PROXIMITY_GUN) { +// if (cl.stats[STAT_ITEMS] & HIT_PROXIMITY_GUN) { // if (flashon) { // grenadeflashing = 1; // Sbar_DrawPic (96, -16, hsb_weapons[flashon][2]); @@ -482,7 +482,7 @@ Sbar_DrawInventory (void) // } // break; // case 3: -// if (cl.items & (IT_SHOTGUN << 4)) { +// if (cl.stats[STAT_ITEMS] & (IT_SHOTGUN << 4)) { // if (flashon && !grenadeflashing) { // Sbar_DrawPic (96, -16, hsb_weapons[flashon][3]); // } else if (!grenadeflashing) { @@ -549,7 +549,7 @@ Sbar_DrawInventory (void) // items 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]; if (time && time > (cl.time - 2) && flashon) { // Flash frame sb_updates = 0; @@ -568,7 +568,7 @@ Sbar_DrawInventory (void) // // hipnotic items // if (hipnotic) { // 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]; // if (time && time > cl.time - 2 && flashon) { // flash // // frame @@ -585,7 +585,7 @@ Sbar_DrawInventory (void) // FIXME: MISSIONHUD // if (rogue) { // new rogue items // 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]; // // if (time && time > (cl.time - 2) && flashon) { // flash @@ -602,7 +602,7 @@ Sbar_DrawInventory (void) // } else { // sigils 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]; if (time && time > cl.time - 2 && flashon) { // flash // frame @@ -728,23 +728,23 @@ Sbar_DrawFace (void) // } // 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)) { Sbar_DrawPic (112, 0, sb_face_invis_invuln); return; } - if (cl.items & IT_QUAD) { + if (cl.stats[STAT_ITEMS] & IT_QUAD) { Sbar_DrawPic (112, 0, sb_face_quad); return; } - if (cl.items & IT_INVISIBILITY) { + if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY) { Sbar_DrawPic (112, 0, sb_face_invis); return; } - if (cl.items & IT_INVULNERABILITY) { + if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY) { Sbar_DrawPic (112, 0, sb_face_invuln); return; } @@ -772,13 +772,13 @@ Sbar_DrawNormal (void) // FIXME: MISSIONHUD // if (hipnotic) { -// if (cl.items & IT_KEY1) +// if (cl.stats[STAT_ITEMS] & IT_KEY1) // 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]); // } // armor - if (cl.items & IT_INVULNERABILITY) { + if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY) { Sbar_DrawNum (24, 0, 666, 3, 1); Sbar_DrawPic (0, 0, draw_disc); } else { @@ -786,20 +786,20 @@ Sbar_DrawNormal (void) // if (rogue) { // Sbar_DrawNum (24, 0, cl.stats[STAT_ARMOR], 3, // cl.stats[STAT_ARMOR] <= 25); -// if (cl.items & RIT_ARMOR3) +// if (cl.stats[STAT_ITEMS] & RIT_ARMOR3) // 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]); -// else if (cl.items & RIT_ARMOR1) +// else if (cl.stats[STAT_ITEMS] & RIT_ARMOR1) // Sbar_DrawPic (0, 0, sb_armor[0]); // } else { Sbar_DrawNum (24, 0, cl.stats[STAT_ARMOR], 3, cl.stats[STAT_ARMOR] <= 25); - if (cl.items & IT_ARMOR3) + if (cl.stats[STAT_ITEMS] & IT_ARMOR3) 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]); - else if (cl.items & IT_ARMOR1) + else if (cl.stats[STAT_ITEMS] & IT_ARMOR1) Sbar_DrawPic (0, 0, sb_armor[0]); // } } @@ -814,28 +814,28 @@ Sbar_DrawNormal (void) // FIXME: MISSIONHUD // // ammo icon // if (rogue) { -// if (cl.items & RIT_SHELLS) +// if (cl.stats[STAT_ITEMS] & RIT_SHELLS) // 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]); -// else if (cl.items & RIT_ROCKETS) +// else if (cl.stats[STAT_ITEMS] & RIT_ROCKETS) // 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]); -// else if (cl.items & RIT_LAVA_NAILS) +// else if (cl.stats[STAT_ITEMS] & RIT_LAVA_NAILS) // 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]); -// else if (cl.items & RIT_MULTI_ROCKETS) +// else if (cl.stats[STAT_ITEMS] & RIT_MULTI_ROCKETS) // Sbar_DrawPic (224, 0, rsb_ammo[2]); // } else { - if (cl.items & IT_SHELLS) + if (cl.stats[STAT_ITEMS] & IT_SHELLS) 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]); - else if (cl.items & IT_ROCKETS) + else if (cl.stats[STAT_ITEMS] & IT_ROCKETS) 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_DrawNum (248, 0, cl.stats[STAT_AMMO], 3, cl.stats[STAT_AMMO] <= 10); diff --git a/nq/source/sw_rmain.c b/nq/source/sw_rmain.c index cd67f724e..c8456fc71 100644 --- a/nq/source/sw_rmain.c +++ b/nq/source/sw_rmain.c @@ -636,7 +636,7 @@ R_DrawViewModel (void) if (chase_active->int_val) return; - if (cl.items & IT_INVISIBILITY) + if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY) return; if (cl.stats[STAT_HEALTH] <= 0) diff --git a/nq/source/sw_view.c b/nq/source/sw_view.c index 5ee0dcdf4..30bde0b01 100644 --- a/nq/source/sw_view.c +++ b/nq/source/sw_view.c @@ -49,28 +49,28 @@ V_CalcPowerupCshift (void) if (!cl_cshift_powerup->int_val) return; - if (cl.items & IT_QUAD - && cl.items & IT_INVULNERABILITY) { + if (cl.stats[STAT_ITEMS] & IT_QUAD + && cl.stats[STAT_ITEMS] & IT_INVULNERABILITY) { cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255; 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[1] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255; 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[1] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0; 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[1] = 100; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 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[1] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 0; diff --git a/qw/source/sw_view.c b/qw/source/sw_view.c index 777eb39c9..b003d5f0e 100644 --- a/qw/source/sw_view.c +++ b/qw/source/sw_view.c @@ -52,7 +52,7 @@ V_CalcPowerupCshift (void) return; if (cl.stats[STAT_ITEMS] & IT_QUAD - && cl.stats[STAT_ITEMS] & IT_INVULNERABILITY) { + && cl.stats[STAT_ITEMS] & IT_INVULNERABILITY) { cl.cshifts[CSHIFT_POWERUP].destcolor[0] = 255; cl.cshifts[CSHIFT_POWERUP].destcolor[1] = 0; cl.cshifts[CSHIFT_POWERUP].destcolor[2] = 255;