(pchrstr, MAXPRCON): Simplify variable-style storage of constituents.

Store only up to MAXPRCON constituents, not MAXCHRNV; code doesn't
fully support more than three anyway.  Remove member p_nv, use item
type I_NONE for unused slots.  Rename members p_vtype, p_vamt to
p_ctype, p_camt to avoid confusion with variable-style storage.
(pchr): Initializers adapted.
(nullify_objects, materials_cost, materials_charge, prod,
show_sect_capab, grind): Adapt, simplify where possible, protect
against bad item types in pchr[].
(MAXCHRNV): Unused, remove.
This commit is contained in:
Markus Armbruster 2004-08-17 15:19:46 +00:00
parent 15d4f89951
commit 4d154753b8
8 changed files with 103 additions and 101 deletions

View file

@ -439,13 +439,13 @@ nullify_objects(void)
dchr[i].d_lcms = 0;
}
for (i = 0; i < prd_maxno; i++) {
for (j = 0; j < pchr[i].p_nv; j++) {
if (opt_NO_HCMS && pchr[i].p_vtype[j] == V_HCM)
pchr[i].p_vamt[j] = 0;
if (opt_NO_LCMS && pchr[i].p_vtype[j] == V_LCM)
pchr[i].p_vamt[j] = 0;
if (opt_NO_OIL && pchr[i].p_vtype[j] == V_OIL)
pchr[i].p_vamt[j] = 0;
for (j = 0; j < MAXPRCON; j++) {
if (opt_NO_HCMS && pchr[i].p_ctype[j] == I_HCM)
pchr[i].p_camt[j] = 0;
if (opt_NO_LCMS && pchr[i].p_ctype[j] == I_LCM)
pchr[i].p_camt[j] = 0;
if (opt_NO_OIL && pchr[i].p_ctype[j] == I_OIL)
pchr[i].p_camt[j] = 0;
}
}
}