/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2005, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2008, 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.
*
* ---
*
* age.c: Age people
- *
+ *
* Known contributors to this file:
* Dave Pare, 1986
*/
-#include "misc.h"
-#include "nat.h"
-#include "file.h"
+#include <config.h>
+
#include "update.h"
-#include "gen.h"
-#include "optlist.h"
void
age_levels(int etu)
{
- register float best_tech;
- register float best_res;
- register struct natstr *np;
+ float best_tech, best_res;
+ struct natstr *np;
int i;
double level;
double delta;
best_tech = 0.0;
best_res = 0.0;
for (i = 0; NULL != (np = getnatp(i)); i++) {
- if ((np->nat_stat & STAT_NORM) == 0)
- continue;
-
- if (np->nat_stat & STAT_GOD)
- continue;
-
- if (np->nat_stat == VIS)
+ if (np->nat_stat != STAT_ACTIVE)
continue;
if (best_tech < np->nat_level[NAT_TLEV])
best_tech /= 5;
best_res /= 5;
for (i = 0; NULL != (np = getnatp(i)); i++) {
- if ((np->nat_stat & STAT_INUSE) == 0)
- continue;
- if (np->nat_stat & STAT_GOD)
- continue;
- if (np->nat_stat == VIS)
+ if (np->nat_stat < STAT_SANCT || np->nat_stat == STAT_GOD)
continue;
level = np->nat_level[NAT_TLEV];
if (level < best_tech && chance(0.2))