/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2016, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2017, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
struct castr *ca = ef_cadef(type);
int i;
- for (i = 0; ca[i].ca_name; i++) {
+ for (i = 0; ca && ca[i].ca_name; i++) {
/*
* Virtual selectors can't be used in xundump, since we lack a
* setter to go with ca_get().
if (!empobj_in_use(type, row_ref))
goto out;
- for (i = 0; ca[i].ca_name; ++i) {
+ for (i = 0; ca && ca[i].ca_name; ++i) {
if (ca[i].ca_get)
continue; /* virtual */
n = CA_ARRAY_LEN(&ca[i]);
continue;
}
if (ca[i].ca_table == type && i == 0) {
- /* uid */
+ /* UID */
if (val.val_as.lng != row) {
verify_fail(type, row, &ca[i], j,
"value is %ld instead of %d",
int retval = 0;
int i;
- if (!ef_cadef(type))
- return 0;
verify_ca(type);
for (i = 0; i < ef_nelem(type); i++)
retval |= verify_row(type, i);
return retval;
}
+static int
+verify_land_chr(void)
+{
+ int retval = 0;
+ int i;
+
+ for (i = 0; lchr[i].l_name; i++) {
+ if (!lchr[i].l_name[0])
+ continue;
+ if ((lchr[i].l_flags & L_SPY) && lchr[i].l_item[I_MILIT]) {
+ verify_fail(EF_LAND_CHR, i, NULL, 0,
+ "flag %s requires zero milit",
+ symbol_by_value(L_SPY, land_chr_flags));
+ retval = -1;
+ }
+ }
+ return retval;
+}
+
static int
verify_products(void)
{
/* Special checks */
retval |= verify_ship_chr();
retval |= verify_plane_chr();
+ retval |= verify_land_chr();
retval |= verify_products();
return retval;
}