]> git.pond.sub.org Git - empserver/blobdiff - src/lib/update/produce.c
Fix trailing whitespace
[empserver] / src / lib / update / produce.c
index 6b00403f1c39388515152dcdd43037eaa80e43b5..4c4c8dcace3384e1d720e6e2416c21af3cf7773c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -26,9 +26,9 @@
  *  ---
  *
  *  produce.c: Produce goodies
- * 
+ *
  *  Known contributors to this file:
- *    
+ *
  */
 
 #include <config.h>
@@ -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;