]> git.pond.sub.org Git - empserver/commitdiff
(produce): Randomly flushed level production below 1.0 to zero. Fix.
authorRon Koenderink <rkoenderink@yahoo.ca>
Tue, 26 Dec 2006 19:15:41 +0000 (19:15 +0000)
committerRon Koenderink <rkoenderink@yahoo.ca>
Tue, 26 Dec 2006 19:15:41 +0000 (19:15 +0000)
(produce): Assign rounded level production to *ACTUAL instead of
randomly rounded one.

src/lib/update/produce.c

index 6b00403f1c39388515152dcdd43037eaa80e43b5..4cc465d74cc5404b68598435d92d88941e3c3872 100644 (file)
@@ -103,16 +103,17 @@ produce(struct natstr *np, struct sctstr *sp, short *vec, int work,
      * Adjust produced amount by commodity production ratio
      */
     output = material_consume * prodeff;
-    actual = roundavg(output);
-    if (actual <= 0)
-       return 0;
     if (item == I_NONE) {
+       actual = ldround(output, 1);
        if (!player->simulation) {
            levels[sp->sct_own][product->p_level] += output;
            wu((natid)0, sp->sct_own, "%s (%.2f) produced in %s\n",
               product->p_name, output, ownxy(sp));
        }
     } else {
+       actual = roundavg(output);
+       if (actual <= 0)
+           return 0;
        if (product->p_nrdep != 0) {
            if (*resource * 100 < product->p_nrdep * actual)
                actual = *resource * 100 / product->p_nrdep;