(prod): Round the final cost instead of truncating along the way.

(prod, produce): Simplify calculation TECH_POP cost factor slightly.
This commit is contained in:
Markus Armbruster 2006-05-21 08:48:16 +00:00
parent 898d1422fa
commit 739b5ac6fb
2 changed files with 5 additions and 6 deletions

View file

@ -165,8 +165,7 @@ produce(struct natstr *np, struct sctstr *sp, short *vec, int work,
if (opt_TECH_POP) {
if (product->p_level == NAT_TLEV) {
if (tpops[sp->sct_own] > 50000)
*cost =
(double)*cost * (double)tpops[sp->sct_own] / 50000.0;
*cost *= tpops[sp->sct_own] / 50000.0;
}
}