/*
* 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
*
* ---
*
- * 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.
*
* ---
*
* Steve McClure, 1998-2000
*/
+#include <config.h>
+
#include <math.h>
#include "misc.h"
#include "player.h"
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;
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) {
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)
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
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]);
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);
}
/* 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 */
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) {
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;
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;
}