]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/dump.c
Update copyright notice
[empserver] / src / lib / commands / dump.c
index d84f3fa2552962a69c634f1fc8413ff75d6ad44a..06568cb96e5efc74c9a6710609dc94e1b0cf54d5 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
- *                           Ken Stevens, Steve McClure
+ *  Copyright (C) 1986-2016, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *                Ken Stevens, Steve McClure, Markus Armbruster
  *
- *  This program is free software; you can redistribute it and/or modify
+ *  Empire is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
+ *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  *  ---
  *
- *  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.
  *
  *  ---
  *
  *  dump.c: Dump sector information
- * 
+ *
  *  Known contributors to this file:
  *     Jeff Wallace, 1989
  *     Steve McClure, 1997 (added timestamping)
  */
 
-#include "misc.h"
-#include "player.h"
-#include "var.h"
-#include "xy.h"
-#include "sect.h"
-#include "nsc.h"
-#include "nat.h"
-#include "path.h"
-#include "file.h"
+#include <config.h>
+
 #include "commands.h"
 #include "optlist.h"
+#include "path.h"
 
 int
 dump(void)
 {
     struct sctstr sect;
-    s_char dirstr[20];
+    char dirstr[20];
     int nsect;
     int n, i;
     struct nstr_sect nstr;
-    int item[I_MAX + 1];
     int field[128];
     struct natstr *np;
     time_t now;
@@ -61,7 +53,6 @@ dump(void)
        return RET_SYN;
     prdate();
     (void)strcpy(dirstr, ".      $");
-    n = 1;
     for (n = 1; n <= 6; n++)
        dirstr[n] = dirch[n];
     nsect = 0;
@@ -249,7 +240,7 @@ dump(void)
     if (player->god)
        pr("   ");
     time(&now);
-    pr("DUMP SECTOR %d\n", now);
+    pr("DUMP SECTOR %ld\n", (long)now);
     if (player->god)
        pr("own ");
     pr("x y");
@@ -510,10 +501,8 @@ dump(void)
 /* census */
        if (player->god)
            pr("%d ", sect.sct_own);
-       getvec(VT_ITEM, item, (s_char *)&sect, EF_SECTOR);
        pr("%d %d", xrel(np, nstr.x), yrel(np, nstr.y));
 
-       set_coastal(&sect);
        n = 0;
        while (field[n]) {
            pr(" ");
@@ -564,47 +553,47 @@ dump(void)
                pr("%d", sect.sct_terr);
                break;
            case 15:
-               pr("%d", item[I_CIVIL]);
+               pr("%d", sect.sct_item[I_CIVIL]);
                break;
            case 16:
-               pr("%d", item[I_MILIT]);
+               pr("%d", sect.sct_item[I_MILIT]);
                break;
            case 17:
-               pr("%d", item[I_UW]);
+               pr("%d", sect.sct_item[I_UW]);
                break;
            case 18:
-               pr("%d", item[I_FOOD]);
+               pr("%d", sect.sct_item[I_FOOD]);
                break;
 /* commodity */
            case 19:
-               pr("%d", item[I_SHELL]);
+               pr("%d", sect.sct_item[I_SHELL]);
                break;
            case 20:
-               pr("%d", item[I_GUN]);
+               pr("%d", sect.sct_item[I_GUN]);
                break;
            case 21:
-               pr("%d", item[I_PETROL]);
+               pr("%d", sect.sct_item[I_PETROL]);
                break;
            case 22:
-               pr("%d", item[I_IRON]);
+               pr("%d", sect.sct_item[I_IRON]);
                break;
            case 23:
-               pr("%d", item[I_DUST]);
+               pr("%d", sect.sct_item[I_DUST]);
                break;
            case 24:
-               pr("%d", item[I_BAR]);
+               pr("%d", sect.sct_item[I_BAR]);
                break;
            case 25:
-               pr("%d", item[I_OIL]);
+               pr("%d", sect.sct_item[I_OIL]);
                break;
            case 26:
-               pr("%d", item[I_LCM]);
+               pr("%d", sect.sct_item[I_LCM]);
                break;
            case 27:
-               pr("%d", item[I_HCM]);
+               pr("%d", sect.sct_item[I_HCM]);
                break;
            case 28:
-               pr("%d", item[I_RAD]);
+               pr("%d", sect.sct_item[I_RAD]);
                break;
 /* cutoff */
            case 29:
@@ -735,7 +724,7 @@ dump(void)
                pr("%d", sect.sct_rail);
                break;
            case 71:
-               pr("%d", sect.sct_defense);
+               pr("%d", SCT_DEFENSE(&sect));
                break;
            case 72:
                if (opt_FALLOUT)