From db0773145d570f2debc4bc517ad20485300d0879 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 19 Mar 2005 17:04:20 +0000 Subject: [PATCH] Fix the previous rev. --- src/lib/update/produce.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/update/produce.c b/src/lib/update/produce.c index 02e7d5cb..92bb7410 100644 --- a/src/lib/update/produce.c +++ b/src/lib/update/produce.c @@ -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;