(alloc_bp, bp_alloc): Rename.

(fill_update_array, bp_set_from_sect): Rename.
(gt_bg_nmbr, pt_bg_nmbr, bp_get_item, bp_get_avail, bp_put_item,
bp_put_avail): Separate accessor functions for item and avail.
This commit is contained in:
Markus Armbruster 2007-01-13 17:11:17 +00:00
parent ec203e88ad
commit c9c06d4fbe
11 changed files with 50 additions and 34 deletions

View file

@ -168,7 +168,7 @@ planerepair(struct plnstr *pp, struct natstr *np, struct bp *bp, int etus)
if (!player->simulation)
avail = sp->sct_avail * 100;
else
avail = gt_bg_nmbr(bp, sp, I_MAX + 1) * 100;
avail = bp_get_avail(bp, sp) * 100;
if (carrier)
avail += etus * carrier->shp_item[I_MILIT] / 2;
@ -198,14 +198,14 @@ planerepair(struct plnstr *pp, struct natstr *np, struct bp *bp, int etus)
if (!player->simulation)
avail = (sp->sct_avail * 100 - used) / 100;
else
avail = (gt_bg_nmbr(bp, sp, I_MAX + 1) * 100 - used) / 100;
avail = (bp_get_avail(bp, sp) * 100 - used) / 100;
if (avail < 0)
avail = 0;
if (!player->simulation)
sp->sct_avail = avail;
else
pt_bg_nmbr(bp, sp, I_MAX + 1, avail);
bp_put_avail(bp, sp, avail);
if (sp->sct_type != SCT_AIRPT)
build /= 3;