/*
* 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
* 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).
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;
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) {