diff --git a/include/var.h b/include/var.h index 8a5efbd0..736af29f 100644 --- a/include/var.h +++ b/include/var.h @@ -34,21 +34,13 @@ #ifndef _VAR_H_ #define _VAR_H_ -#define V_MAX 255 - #define PLG_HEALTHY 0 #define PLG_DYING 1 #define PLG_INFECT 2 #define PLG_INCUBATE 3 #define PLG_EXPOSED 4 -#define VT_ITEM 0 -#define VT_TYPE (7<<5) - -#define isitem(x) (((x) & VT_TYPE) == VT_ITEM) -#define unitem(x) ((x) & (VT_ITEM -1)) - -#define V_ITEM(x) ((x)|VT_ITEM) /* a moveable, sellable(?) commodity */ +#define V_ITEM(x) (x) #define I_NONE 0 #define I_CIVIL 1 diff --git a/src/lib/subs/show.c b/src/lib/subs/show.c index 11fedc96..b7476903 100644 --- a/src/lib/subs/show.c +++ b/src/lib/subs/show.c @@ -685,8 +685,6 @@ show_sect_capab(int foo) { register int x, first = 1, i, j; char *tmpstr; - char c; - char *outputs = " cmsgpidbfolhur"; for (x = 0; x < SCT_MAXDEF + 2; x++) { if ((dchr[x].d_mnem == 0) || (dchr[x].d_prd == 0)) @@ -708,7 +706,7 @@ show_sect_capab(int foo) && pchr[j].p_ctype[i] > I_NONE && pchr[j].p_ctype[i] <= I_MAX) { pr("%2d %c ", pchr[j].p_camt[i], - ichr[pchr[j].p_ctype[i] & (~VT_ITEM)].i_name[0]); + ichr[pchr[j].p_ctype[i]].i_name[0]); } else { pr(" "); } @@ -730,15 +728,12 @@ show_sect_capab(int foo) tmpstr = " "; break; } - if (pchr[j].p_type) - c = outputs[pchr[j].p_type - VT_ITEM]; - else - c = ' '; pr("%-5s %3d %3d %4d %3d %3d %c", tmpstr, pchr[j].p_nlmin, pchr[j].p_nllag, - pchr[j].p_effic, pchr[j].p_cost, pchr[j].p_nrdep, c); + pchr[j].p_effic, pchr[j].p_cost, pchr[j].p_nrdep, + pchr[j].p_type ? ichr[pchr[j].p_type].i_mnem : ' '); pr("\n"); } diff --git a/src/lib/update/produce.c b/src/lib/update/produce.c index 43acfc11..77c3527a 100644 --- a/src/lib/update/produce.c +++ b/src/lib/update/produce.c @@ -73,8 +73,7 @@ produce(struct natstr *np, struct sctstr *sp, short *vec, int work, product = &pchr[dchr[desig].d_prd]; if (product == &pchr[0]) return 0; - vtype = product->p_type; - item = vtype & ~VT_ITEM; + item = product->p_type; *amount = 0; *cost = 0; @@ -112,7 +111,7 @@ produce(struct natstr *np, struct sctstr *sp, short *vec, int work, * Adjust produced amount by commodity production ratio */ output = material_consume * prodeff; - if ((vtype == 0) && (!player->simulation)) { + if (item == I_NONE && !player->simulation) { levels[sp->sct_own][product->p_level] += output; wu((natid)0, sp->sct_own, "%s (%.2f) produced in %s\n", product->p_name, output, ownxy(sp));