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
|
@ -248,7 +248,6 @@ shiprepair(struct shpstr *ship, struct natstr *np, struct bp *bp, int etus)
|
|||
int wf;
|
||||
int avail;
|
||||
int mult;
|
||||
int mvec[I_MAX + 1];
|
||||
|
||||
mp = &mchr[(int)ship->shp_type];
|
||||
sp = getsectp(ship->shp_x, ship->shp_y);
|
||||
|
@ -293,10 +292,7 @@ shiprepair(struct shpstr *ship, struct natstr *np, struct bp *bp, int etus)
|
|||
if (delta > 100 - ship->shp_effic)
|
||||
delta = 100 - ship->shp_effic;
|
||||
|
||||
memset(mvec, 0, sizeof(mvec));
|
||||
mvec[I_LCM] = mp->m_lcm;
|
||||
mvec[I_HCM] = mp->m_hcm;
|
||||
build = get_materials(sp, bp, mvec, delta);
|
||||
build = get_materials(sp, bp, mp->m_mat, delta);
|
||||
|
||||
if (sp->sct_type != SCT_HARBR)
|
||||
build = delta;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue