]> git.pond.sub.org Git - empserver/blobdiff - src/lib/update/nav_util.c
COPYING duplicates information from README. Remove. Move GPL from
[empserver] / src / lib / update / nav_util.c
index f193cb0953189660ad99ece59bdb08ebad21a879..9c1ea533e0ec7483da44a462fe38ec936ce1a7bd 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.
  *
  *  ---
  *
  *     
  */
 
+#include <config.h>
+
 #include "misc.h"
 
 #include <ctype.h>
-#include "var.h"
+#include "plague.h"
 #include "ship.h"
 #include "plane.h"
 #include "land.h"
-#include "nuke.h"
 #include "sect.h"
-#include "news.h"
 #include "xy.h"
 #include "nsc.h"
 #include "nat.h"
 #include "common.h"
 #include "gen.h"
 
-/* Format a ship name */
-int
-check_nav(struct sctstr *sect)
-{
-    switch (dchr[sect->sct_type].d_flg & 03) {
-    case NAVOK:
-       break;
-
-    case NAV_02:
-       if (sect->sct_effic < 2)
-           return CN_CONSTRUCTION;
-       break;
-    case NAV_60:
-       if (sect->sct_effic < 60)
-           return CN_CONSTRUCTION;
-       break;
-    default:
-       return CN_LANDLOCKED;
-    }
-    return CN_NAVIGABLE;
-}
-
 /* load a specific ship given its 
  * location and what field to modify.
  * new autonav code
@@ -113,7 +91,7 @@ load_it(struct shpstr *sp, struct sctstr *psect, int i)
     if (!abs_max)
        return 0;               /* can't load the ship, skip to the end. */
 
-    max_amt = min(sect_amt, max_amt - ship_amt);
+    max_amt = MIN(sect_amt, max_amt - ship_amt);
     if (max_amt <= 0 && (ship_amt != abs_max)) {
        sp->shp_autonav |= AN_LOADING;
        return 0;
@@ -199,7 +177,7 @@ unload_it(struct shpstr *sp)
        if (comm == I_CIVIL)
            ship_amt--;         /* This leaves 1 civs on board the ship */
 
-       max_amt = min(ship_amt, ITEM_MAX - sect_amt);
+       max_amt = MIN(ship_amt, ITEM_MAX - sect_amt);
        if (max_amt <= 0)
            continue;