]> git.pond.sub.org Git - empserver/commitdiff
Fix production command not to limit level production to 999
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 9 Aug 2008 13:03:03 +0000 (09:03 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 9 Aug 2008 13:03:03 +0000 (09:03 -0400)
Item production is limited to 999 units, level production is
unlimited.

Commit 0e721173 (v4.2.15) changed prod() from no limit to 999 units,
which fixed it for items, and broke it for levels.  Undo the change
for levels.

src/lib/commands/prod.c

index c24c9b5823405f85af46b0341ac0018b6150ca4b..18f892893c1666146dc5f79a58a5dd8f1bef0719 100644 (file)
@@ -30,7 +30,7 @@
  *  Known contributors to this file:
  *     David Muir Sharnoff, 1987
  *     Steve McClure, 1997-2000
- *     Markus Armbruster, 2004-2006
+ *     Markus Armbruster, 2004-2008
  */
 
 #include <config.h>
@@ -250,10 +250,12 @@ prod(void)
        }
        act = MIN(used, max);
 
-       real = MIN(999.0, (double)act * prodeff);
-       maxr = MIN(999.0, (double)max * prodeff);
+       real = (double)act * prodeff;
+       maxr = (double)max * prodeff;
 
        if (vtype != I_NONE) {
+           real = MIN(999.0, real);
+           maxr = MIN(999.0, maxr);
            if (real < 0.0)
                real = 0.0;
            /* production backlog? */