/*
* 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
*
* ---
*
- * 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, 1996
*/
+#include <config.h>
+
#include "misc.h"
#include "plague.h"
#include "sect.h"
#include "ship.h"
#include "news.h"
#include "file.h"
-#include "product.h"
#include "optlist.h"
#include "budg.h"
#include "player.h"
int mil_dbl_pay;
-#ifndef MIN
-#define MIN(x,y) ((x) > (y) ? (y) : (x))
-#endif
-
static int landrepair(struct lndstr *, struct natstr *,
int *, int);
static void upd_land(struct lndstr *lp, int etus,
start_money = np->nat_money;
upd_land(lp, etus, np, bp, build);
lnd_money[lp->lnd_own] += np->nat_money - start_money;
- if ((build && (np->nat_money != start_money)) || (!build))
+ if (!build || np->nat_money != start_money)
k++;
if (player->simulation)
np->nat_money = start_money;
/* build = 1, maintain = 0 */
{
struct lchrstr *lcp;
- int pstage, ptime;\r
+ int pstage, ptime;
int n;
int min = morale_base - (int)np->nat_level[NAT_HLEV];
int mult;
mult = 2;
if (lcp->l_flags & L_ENGINEER)
mult *= 3;
-/* cost = -(mult * etus * dmin(0.0, money_land * LND_COST(lcp->l_cost, lp->lnd_tech - lcp->l_tech)));*/
- cost = -(mult * etus * dmin(0.0, money_land * lcp->l_cost));
+/* cost = -(mult * etus * MIN(0.0, money_land * LND_COST(lcp->l_cost, lp->lnd_tech - lcp->l_tech)));*/
+ cost = -(mult * etus * MIN(0.0, money_land * lcp->l_cost));
if ((np->nat_priorities[PRI_LMAINT] == 0 || np->nat_money < cost)
&& !player->simulation) {
if ((eff = lp->lnd_effic - etus / 5) < LAND_MINEFF) {
delta = roundavg((double)avail / w_p_eff);
if (delta <= 0)
return 1;
- if (delta > etus * land_grow_scale)
- delta = etus * land_grow_scale;
+ if (delta > (int)((float)etus * land_grow_scale))
+ delta = (int)((float)etus * land_grow_scale);
/* delta is the max amount we can grow */