]> git.pond.sub.org Git - empserver/commitdiff
Fix the previous rev.
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 19 Mar 2005 17:04:20 +0000 (17:04 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 19 Mar 2005 17:04:20 +0000 (17:04 +0000)
src/lib/update/produce.c

index 02e7d5cb3b91525f8fff65a10b13cf724eb8608a..92bb7410111d0d70c3c344d81a63736ca2a1e6b1 100644 (file)
@@ -108,6 +108,9 @@ 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) {
        if (!player->simulation) {
            levels[sp->sct_own][product->p_level] += output;
@@ -115,8 +118,6 @@ produce(struct natstr *np, struct sctstr *sp, short *vec, int work,
               product->p_name, output, ownxy(sp));
        }
     } else {
-       if ((actual = roundavg(output)) <= 0)
-           return 0;
        if (product->p_nrdep != 0) {
            if (*resource * 100 < product->p_nrdep * actual)
                actual = *resource * 100 / product->p_nrdep;