]> git.pond.sub.org Git - empserver/blobdiff - src/lib/update/plane.c
COPYING duplicates information from README. Remove. Move GPL from
[empserver] / src / lib / update / plane.c
index 2ea598ea31d695113690c16395ae51e3fbcfbf8a..ed59081d851933cf6a01527de97c24403f189296 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2004, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -19,9 +19,9 @@
  *
  *  ---
  *
- *  See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- *  related information and legal notices. It is expected that any future
- *  projects/authors will amend these files as needed.
+ *  See files README, COPYING and CREDITS in the root of the source
+ *  tree for related information and legal notices.  It is expected
+ *  that future projects/authors will amend these files as needed.
  *
  *  ---
  *
@@ -32,6 +32,8 @@
  *     Steve McClure, 1998
  */
 
+#include <config.h>
+
 #include "misc.h"
 #include "sect.h"
 #include "plane.h"
 #include "common.h"
 #include "gen.h"
 
-#ifndef MIN
-#define MIN(x,y)        ((x) > (y) ? (y) : (x))
-#endif
-
 int
 prod_plane(int etus, int natnum, int *bp, int buildem)
 
@@ -77,7 +75,7 @@ prod_plane(int etus, int natnum, int *bp, int buildem)
     int avail;
     int w_p_eff;
     int used;
-    int start_money, onship = 0;
+    int start_money, onship;
 
     for (n = 0; NULL != (pp = getplanep(n)); n++) {
        if (pp->pln_own == 0)
@@ -131,7 +129,7 @@ prod_plane(int etus, int natnum, int *bp, int buildem)
        if (buildem == 0) {
            /* flight pay is 5x the pay received by other military */
            start_money = np->nat_money;
-           cost = -(mult * etus * dmin(0.0, desc->pl_cost * money_plane));
+           cost = -(mult * etus * MIN(0.0, desc->pl_cost * money_plane));
            if ((np->nat_priorities[PRI_PMAINT] == 0 ||
                 np->nat_money < cost) && !player->simulation) {
                if ((eff = pp->pln_effic - etus / 5) < PLANE_MINEFF) {
@@ -182,8 +180,8 @@ prod_plane(int etus, int natnum, int *bp, int buildem)
            delta = roundavg((double)avail / w_p_eff);
            if (delta <= 0)
                continue;
-           if (delta > etus * plane_grow_scale)
-               delta = etus * plane_grow_scale;
+           if (delta > (int)((float)etus * plane_grow_scale))
+               delta = (int)((float)etus * plane_grow_scale);
            if (delta > left)
                delta = left;