]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/lndsub.c
COPYING duplicates information from README. Remove. Move GPL from
[empserver] / src / lib / subs / lndsub.c
index 19aa016734c7ee6c599aa01b2a0b56b0ae2fa99b..39e023dc54962ecf03b6192d09c3692a00965bc4 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2005, 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-2000
  */
 
+#include <config.h>
+
 #include <math.h>
 #include "misc.h"
 #include "player.h"
@@ -188,7 +190,7 @@ lnd_take_casualty(int combat_mode, struct llist *llp, int cas)
     s_char orig;
     int mob;
 
-    taken = lnd_getmil(&(llp->land));
+    taken = lnd_getmil(&llp->land);
     /* Spies always die */
     if (llp->lcp->l_flags & L_SPY) {
        eff_eq = 100;
@@ -197,7 +199,7 @@ lnd_take_casualty(int combat_mode, struct llist *llp, int cas)
        eff_eq =
            ldround((((double)cas * 100.0) / (double)llp->lcp->l_mil), 1);
        llp->land.lnd_effic -= eff_eq;
-       lnd_submil(&(llp->land), cas);
+       lnd_submil(&llp->land, cas);
     }
 
     if (llp->land.lnd_effic < LAND_MINEFF) {
@@ -209,7 +211,7 @@ lnd_take_casualty(int combat_mode, struct llist *llp, int cas)
        return taken;
     } else {
        /* Ok, now, how many did we take off? (sould be the diff) */
-       taken = taken - lnd_getmil(&(llp->land));
+       taken = taken - lnd_getmil(&llp->land);
     }
 
     if (llp->land.lnd_effic >= llp->land.lnd_retreat)
@@ -390,7 +392,7 @@ intelligence_report(int destination, struct lndstr *lp, int spy,
            if (chance((double)(spy + lp->lnd_vis) / 20.0)) {
                int t;
                t = lp->lnd_tech - 20 + roll(40);
-               t = max(t, 0);
+               t = MAX(t, 0);
                if (destination == player->cnum)
                    pr(", tech %d)\n", t);
                else
@@ -789,7 +791,7 @@ lnd_list(struct emp_qelem *land_list)
        pr("%4d ", lnd->lnd_uid);
        pr("%-16.16s ", llp->lcp->l_name);
        prxy("%4d,%-4d ", lnd->lnd_x, lnd->lnd_y, llp->land.lnd_own);
-       pr("%1c", lnd->lnd_army);
+       pr("%c", lnd->lnd_army);
        pr("%4d%%", lnd->lnd_effic);
        pr("%4d", lnd->lnd_item[I_SHELL]);
        pr("%4d", lnd->lnd_item[I_GUN]);
@@ -936,7 +938,7 @@ lnd_fort_interdiction(struct emp_qelem *list,
        gun = fsect.sct_item[I_GUN];
        if (gun < 1)
            continue;
-       range = tfactfire(fsect.sct_own, (double)min(gun, 7));
+       range = tfactfire(fsect.sct_own, (double)MIN(gun, 7));
        if (fsect.sct_effic > 59)
            range++;
        range2 = roundrange(range);
@@ -1127,9 +1129,9 @@ lnd_mar_one_sector(struct emp_qelem *list, int dir, natid actor,
        }
        /* Note we check would_abandon first because we don't want
           to always have to do these checks */
-       if (would_abandon(&osect, I_CIVIL, 0, &(llp->land))) {
+       if (would_abandon(&osect, I_CIVIL, 0, &llp->land)) {
            stop = 0;
-           if (!want_to_abandon(&osect, I_CIVIL, 0, &(llp->land))) {
+           if (!want_to_abandon(&osect, I_CIVIL, 0, &llp->land)) {
                stop = 1;
            }
            /* now check stuff */
@@ -1138,7 +1140,7 @@ lnd_mar_one_sector(struct emp_qelem *list, int dir, natid actor,
            if (!check_sect_ok(&osect))
                return 1;
            for (qp2 = list->q_back; qp2 != list; qp2 = qp2->q_back) {
-               if (!check_land_ok(&(((struct llist *)qp2)->land)))
+               if (!check_land_ok(&((struct llist *)qp2)->land))
                    return 1;
            }
            if (stop) {
@@ -1376,7 +1378,7 @@ lnd_fortify (struct lndstr *lp, int hard_amt)
     if ((lp->lnd_ship >= 0) || lp->lnd_land >= 0)
        return 0;
 
-    hard_amt = min(lp->lnd_mobil, hard_amt);
+    hard_amt = MIN(lp->lnd_mobil, hard_amt);
 
     if ((lp->lnd_harden + hard_amt) > land_mob_max)
        hard_amt = land_mob_max - lp->lnd_harden;
@@ -1407,7 +1409,7 @@ lnd_fortify (struct lndstr *lp, int hard_amt)
        lp->lnd_mobil = 0;
 
     lp->lnd_harden += hard_amt;
-    lp->lnd_harden = min(lp->lnd_harden, land_mob_max);
+    lp->lnd_harden = MIN(lp->lnd_harden, land_mob_max);
 
     return hard_amt;
 }