update: Drop redundant bp_put_items() parameter vec[]
All its callers pass sp->sct_item, so use that. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
cd418e0686
commit
51c5c65654
3 changed files with 10 additions and 10 deletions
|
@ -45,7 +45,7 @@ struct bp *bp_alloc(void);
|
|||
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);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
*
|
||||
* Known contributors to this file:
|
||||
* Ville Virrankoski, 1996
|
||||
* Markus Armbruster, 2007
|
||||
* Markus Armbruster, 2007-2016
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -99,9 +99,9 @@ bp_put_item(struct bp *bp, struct sctstr *sp, i_type comm, int amount)
|
|||
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);
|
||||
|
@ -110,7 +110,7 @@ bp_put_items(struct bp *bp, struct sctstr *sp, short *vec)
|
|||
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];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ bp_put_avail(struct bp *bp, struct sctstr *sp, int amount)
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -288,7 +288,7 @@ produce_sect(struct natstr *np, int etu, struct bp *bp, int p_sect[][2])
|
|||
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;
|
||||
|
@ -310,7 +310,7 @@ produce_sect(struct natstr *np, int etu, struct bp *bp, int p_sect[][2])
|
|||
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) {
|
||||
|
@ -326,7 +326,7 @@ produce_sect(struct natstr *np, int etu, struct bp *bp, int p_sect[][2])
|
|||
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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -337,7 +337,7 @@ produce_sect(struct natstr *np, int etu, struct bp *bp, int p_sect[][2])
|
|||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue