config: Generalize unit build materials storage
Use a single array member instead of multiple scalar members. Only the array elements that replace scalar members are can be non-zero for now. This is a first step to permitting more build materials. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
68c7c08a58
commit
da05484d8b
17 changed files with 79 additions and 100 deletions
|
@ -200,7 +200,6 @@ landrepair(struct lndstr *land, struct natstr *np, struct bp *bp, int etus)
|
|||
int build;
|
||||
int avail;
|
||||
int mult;
|
||||
int mvec[I_MAX + 1];
|
||||
|
||||
lp = &lchr[(int)land->lnd_type];
|
||||
sp = getsectp(land->lnd_x, land->lnd_y);
|
||||
|
@ -230,10 +229,7 @@ landrepair(struct lndstr *land, struct natstr *np, struct bp *bp, int etus)
|
|||
if (delta > 100 - land->lnd_effic)
|
||||
delta = 100 - land->lnd_effic;
|
||||
|
||||
memset(mvec, 0, sizeof(mvec));
|
||||
mvec[I_LCM] = lp->l_lcm;
|
||||
mvec[I_HCM] = lp->l_hcm;
|
||||
build = get_materials(sp, bp, mvec, delta);
|
||||
build = get_materials(sp, bp, lp->l_mat, delta);
|
||||
|
||||
if ((sp->sct_type != SCT_HEADQ) && (sp->sct_type != SCT_FORTR))
|
||||
build /= 3;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue