All its callers pass sp->sct_item, so use that.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
void bp_set_from_sect(struct bp *, struct sctstr *);
int bp_get_item(struct bp *, struct sctstr *, i_type);
void bp_put_item(struct bp *, struct sctstr *, i_type, int);
-void bp_put_items(struct bp *, struct sctstr *, short *);
+void bp_put_items(struct bp *, struct sctstr *);
int bp_get_avail(struct bp *, struct sctstr *);
void bp_put_avail(struct bp *, struct sctstr *, int);
*
* Known contributors to this file:
* Ville Virrankoski, 1996
- * Markus Armbruster, 2007
+ * Markus Armbruster, 2007-2016
*/
/*
bp_ref(bp, sp)->bp_item[idx] = amount;
}
-/* Set the item values tracked in @bp for sector @sp from @vec. */
+/* Set the item values tracked in @bp from sector @sp. */
void
-bp_put_items(struct bp *bp, struct sctstr *sp, short *vec)
+bp_put_items(struct bp *bp, struct sctstr *sp)
{
enum bp_item_idx idx;
struct bp *p = bp_ref(bp, sp);
for (i = I_NONE + 1; i <= I_MAX; i++) {
idx = bud_key[i];
if (idx >= 0)
- p->bp_item[idx] = vec[i];
+ p->bp_item[idx] = sp->sct_item[i];
}
}
void
bp_set_from_sect(struct bp *bp, struct sctstr *sp)
{
- bp_put_items(bp, sp, sp->sct_item);
+ bp_put_items(bp, sp);
bp_put_avail(bp, sp, sp->sct_avail);
}
work = 0;
do_feed(sp, np, sp->sct_item, &work, etu);
- bp_put_items(bp, sp, sp->sct_item);
+ bp_put_items(bp, sp);
if (sp->sct_off || np->nat_money < 0)
continue;
if ((sp->sct_effic < 100 || sp->sct_type != sp->sct_newtype) &&
np->nat_money >= 0) {
neweff = upd_buildeff(sp, &work, sp->sct_item, &desig, &cost);
- bp_put_items(bp, sp, sp->sct_item);
+ bp_put_items(bp, sp);
p_sect[SCT_EFFIC][0]++;
p_sect[SCT_EFFIC][1] += cost;
if (!player->simulation) {
p_sect[desig][1] += ecost;
if (!player->simulation)
np->nat_money -= ecost;
- bp_put_items(bp, sp, sp->sct_item);
+ bp_put_items(bp, sp);
}
/*
if (np->nat_money >= 0 && dchr[desig].d_prd >= 0)
work -= produce(np, sp, sp->sct_item, work, desig, neweff,
&pcost, &amount);
- bp_put_items(bp, sp, sp->sct_item);
+ bp_put_items(bp, sp);
}
bp_put_avail(bp, sp, work);