]> git.pond.sub.org Git - empserver/blobdiff - src/lib/common/xdump.c
Update copyright notice
[empserver] / src / lib / common / xdump.c
index e98e62849ac348c3ec37080cad23b1fc2df03b64..e62960427247cfcebf9e0c5a3d48eee0df570519 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-2018, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
@@ -27,7 +27,7 @@
  *  xdump.c: Extended dumps
  *
  *  Known contributors to this file:
- *     Markus Armbruster, 2004-2014
+ *     Markus Armbruster, 2004-2016
  */
 
 /*
 
 #include <ctype.h>
 #include <limits.h>
-#include "file.h"
 #include "nat.h"
 #include "xdump.h"
 
 /*
  * Initialize @xd.
+ * If @cnum is NATID_BAD, this is an empdump export rather than an
+ * xdump command.
  * Translate dump for country @cnum, except when @cnum is NATID_BAD.
+ * Ignore CA_DUMP_ONLY selectors when @cnum is NATID_BAD.
  * If @human, dump in human-readable format.
  * If @sloppy, try to cope with invalid data (may result in invalid
  * dump).
@@ -242,7 +244,9 @@ xdflds(struct xdstr *xd, struct castr ca[], void *ptr)
     for (i = 0; ca[i].ca_name; ++i) {
        if (ca[i].ca_flags & NSC_DEITY && !xd->divine)
            continue;
-       if (ca[i].ca_flags & NSC_EXTRA)
+       if (ca[i].ca_dump == CA_DUMP_NONE)
+           continue;
+       if (ca[i].ca_dump == CA_DUMP_ONLY && xd->cnum == NATID_BAD)
            continue;
        n = CA_ARRAY_LEN(&ca[i]);
        j = 0;
@@ -285,7 +289,7 @@ xdcolhdr(struct xdstr *xd, struct castr ca[])
     for (i = 0; ca[i].ca_name; ++i) {
        if (ca[i].ca_flags & NSC_DEITY && !xd->divine)
            continue;
-       if (ca[i].ca_flags & NSC_EXTRA)
+       if (ca[i].ca_dump == CA_DUMP_NONE)
            continue;
        n = CA_ARRAY_LEN(&ca[i]);
        if (n) {