]> git.pond.sub.org Git - empserver/blobdiff - src/lib/update/finish.c
Update copyright notice
[empserver] / src / lib / update / finish.c
index 668a261e720dce413bddcabed747689f12d0799f..965a87432f8eadd905e3e7b03ef5a3c7f0dd9c86 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2016, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
  *     Dave Pare, 1986
  *     Thomas Ruschak, 1993
  *     Steve McClure, 1998
- *     Markus Armbruster, 2004-2011
+ *     Markus Armbruster, 2004-2016
  */
 
 #include <config.h>
 
 #include <stdlib.h>
 #include <sys/resource.h>
-#include "distribute.h"
-#include "file.h"
-#include "nat.h"
 #include "optlist.h"
 #include "path.h"
 #include "sect.h"
@@ -53,7 +50,6 @@ finish_sects(int etu)
 {
     static double *import_cost;
     struct sctstr *sp;
-    struct natstr *np;
     int n;
     struct rusage rus1, rus2;
 
@@ -69,12 +65,9 @@ finish_sects(int etu)
     logerror("delivering...\n");
     /* Do deliveries */
     for (n = 0; NULL != (sp = getsectid(n)); n++) {
-       if (sp->sct_type == SCT_WATER)
+       if (!sp->sct_own || sp->sct_type == SCT_SANCT)
            continue;
-       if (sp->sct_own == 0)
-           continue;
-       np = getnatp(sp->sct_own);
-       if (np->nat_money < 0)
+       if (nat_budget[sp->sct_own].money < 0)
            continue;
        dodeliver(sp);
     }
@@ -92,10 +85,9 @@ finish_sects(int etu)
 
     logerror("exporting...");
     for (n = 0; NULL != (sp = getsectid(n)); n++) {
-       if (!sp->sct_own)
+       if (!sp->sct_own || sp->sct_type == SCT_SANCT)
            continue;
-       np = getnatp(sp->sct_own);
-       if (np->nat_money < 0)
+       if (nat_budget[sp->sct_own].money < 0)
            continue;
        dodistribute(sp, EXPORT, import_cost[n]);
     }
@@ -104,10 +96,9 @@ finish_sects(int etu)
     logerror("importing...");
     for (n = 0; NULL != (sp = getsectid(n)); n++) {
        sp->sct_off = 0;
-       if (!sp->sct_own)
+       if (!sp->sct_own || sp->sct_type == SCT_SANCT)
            continue;
-       np = getnatp(sp->sct_own);
-       if (np->nat_money < 0)
+       if (nat_budget[sp->sct_own].money < 0)
            continue;
        dodistribute(sp, IMPORT, import_cost[n]);
     }