neweff prod work: Use update code instead of duplicating it

The code to build sectors got quadruplicated in Chainsaw.  We've since
fixed numerous inconsistencies, but still have four copies of the
code.  Thanks to the recent work on upd_buildeff(), we can now use it
to replace the other three copies.  Rename it back to to buildeff()
while there.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2016-06-04 10:55:44 +02:00
parent 41a2f7d1df
commit b7b99c95c2
5 changed files with 31 additions and 191 deletions

View file

@ -44,8 +44,8 @@
#include "ship.h"
#include "update.h"
static int
upd_buildeff(struct sctstr *sp)
int
buildeff(struct sctstr *sp)
{
int work_cost = 0;
int avail = sp->sct_avail;
@ -304,7 +304,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) {
cost = upd_buildeff(sp);
cost = buildeff(sp);
bp_put_items(bp, sp);
p_sect[SCT_EFFIC][0]++;
p_sect[SCT_EFFIC][1] += cost;