/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2007, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
#include <config.h>
-#include "misc.h"
-#include "nat.h"
-#include "file.h"
-#include "sect.h"
-#include "player.h"
-#include "empthread.h"
#include "budg.h"
-#include "player.h"
-#include "update.h"
-#include "common.h"
-#include "optlist.h"
+#include "empthread.h"
#include "journal.h"
+#include "player.h"
#include "server.h"
-#include <stdlib.h>
-#if !defined(_WIN32)
-#include <sys/time.h>
-#endif
+#include "update.h"
long money[MAXNOC];
long pops[MAXNOC];
if (CANT_HAPPEN(!update_pending))
update_pending = 1;
+ logerror("production update (%d etus)", etu);
+ journal_update(etu);
+
/* First, make sure all mobility is updated correctly. */
if (opt_MOB_ACCESS) {
mob_ship(etu);
player->proc = empth_self();
player->cnum = 0;
player->god = 1;
+
+ if (opt_AUTO_POWER)
+ update_power();
+
/*
* set up all the variables which get used in the
* sector production routine (for producing education,
* happiness, and printing out the state of the nation)
*/
- logerror("production update (%d etus)", etu);
- journal_update(etu);
memset(pops, 0, sizeof(pops));
memset(air_money, 0, sizeof(air_money));
memset(sea_money, 0, sizeof(sea_money));
logerror("done preparing sectors.");
logerror("producing for countries...");
for (x = 0; x < MAXNOC; x++) {
- int y, z;
- long p_sect[SCT_MAXDEF+1][2];
+ long p_sect[SCT_TYPE_MAX+2][2];
memset(p_sect, 0, sizeof(p_sect));
- mil_dbl_pay = 0;
if (!(np = getnatp(x)))
continue;
if (np->nat_stat == STAT_SANCT) {
/* produce all sects */
produce_sect(x, etu, bp, p_sect);
- np->nat_money -= p_sect[SCT_CAPIT][1];
/* build units */
prod_ship(etu, x, bp, 1);