(total_work): Remove redundant conversion to int.

(total_work): New parameter maxpop.  Callers changed.
(newe, prod): Use total_work().  Old code failed to limit military
workers, thus didn't match the update.
(do_feed): Simplify.
This commit is contained in:
Markus Armbruster 2005-02-20 19:36:41 +00:00
parent 43d07b458d
commit 5ba8cab9b5
6 changed files with 40 additions and 43 deletions

View file

@ -71,14 +71,12 @@ newe(void)
uws = (1.0 + uwbrate * etu_per_update) * sect.sct_item[I_UW];
natp = getnatp(sect.sct_own);
maxpop = max_pop(natp->nat_level[NAT_RLEV], &sect);
civs = min(civs, maxpop);
uws = min(uws, maxpop);
/* This isn't quite right, since research might rise/fall */
/* during the update, but it's the best we can really do */
wforce = (int)((civs * sect.sct_work) / 100.0
+ uws + sect.sct_item[I_MILIT] * 2 / 5.0);
work = new_work(&sect, wforce * etu_per_update / 100);
work = new_work(&sect,
total_work(sect.sct_work, etu_per_update,
civs, sect.sct_item[I_MILIT], uws,
maxpop));
bwork = work / 2;
type = sect.sct_type;