]> git.pond.sub.org Git - empserver/blobdiff - src/lib/update/main.c
Update copyright notice
[empserver] / src / lib / update / main.c
index 790e59e733f5af8baabbe1b1f194df409a51e9e8..730befbb60bed25a9407146303927211bd1fae43 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2007, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
  *  ---
  *
  *  main.c: World update main function
- * 
+ *
  *  Known contributors to this file:
  *     Dave Pare, 1994
  *     Steve McClure, 1996
  *     Doug Hay, 1998
+ *     Markus Armbruster, 2006-2007
  */
 
 #include <config.h>
 
 #include "budg.h"
 #include "empthread.h"
+#include "game.h"
 #include "journal.h"
 #include "player.h"
 #include "server.h"
+#include "unit.h"
 #include "update.h"
 
 long money[MAXNOC];
@@ -61,14 +64,15 @@ update_main(void)
     struct natstr *np;
 
     logerror("production update (%d etus)", etu);
+    game_record_update(time(NULL));
     journal_update(etu);
 
     /* First, make sure all mobility is updated correctly. */
     if (opt_MOB_ACCESS) {
-       mob_ship(etu);
-       mob_sect(etu);
-       mob_plane(etu);
-       mob_land(etu);
+       mob_ship();
+       mob_sect();
+       mob_plane();
+       mob_land();
     }
 
     if (opt_AUTO_POWER)
@@ -129,7 +133,6 @@ update_main(void)
     prod_nat(etu);
     age_levels(etu);
     free(bp);
-    /*flushwu(); */
     if (opt_SLOW_WAR) {
        /* Update war declarations */
        /* MOBILIZATION->SITZKRIEG->AT_WAR */
@@ -153,10 +156,10 @@ update_main(void)
     /* Only update mobility for non-MOB_ACCESS here, since it doesn't
        get done for MOB_ACCESS anyway during the update */
     if (!opt_MOB_ACCESS) {
-       mob_ship(etu);
-       mob_sect(etu);
-       mob_plane(etu);
-       mob_land(etu);
+       mob_ship();
+       mob_sect();
+       mob_plane();
+       mob_land();
     }
     if (update_demand == UPD_DEMAND_SCHED
        || update_demand == UPD_DEMAND_ASYNC)
@@ -167,8 +170,10 @@ update_main(void)
     ef_flush(EF_SHIP);
     ef_flush(EF_PLANE);
     ef_flush(EF_LAND);
+    unit_cargo_init();
     delete_old_announcements();
     delete_old_news();
+    delete_old_lostitems();
     /* Clear all the telegram flags */
     for (cn = 0; cn < MAXNOC; cn++)
        clear_telegram_is_new(cn);