fix reading data from very old files

This commit is contained in:
Enno Rehling 2016-08-05 21:58:06 +02:00
parent 8f9bfe85b6
commit 50860ea0ef
1 changed files with 5 additions and 7 deletions

View File

@ -651,17 +651,12 @@ int read_borders(gamedata *data)
if (r != NULL) if (r != NULL)
to = r; to = r;
} }
if ((type->read && !type->write)) { if (type->read) {
log_warning("ignore invalid border '%s' between '%s' and '%s'\n", zText, regionname(from, 0), regionname(to, 0));
}
else {
connection *b = new_border(type, from, to); connection *b = new_border(type, from, to);
nextborder--; /* new_border erhöht den Wert */ nextborder--; /* new_border erhöht den Wert */
b->id = bid; b->id = bid;
assert(bid <= nextborder); assert(bid <= nextborder);
if (type->read) { type->read(b, data);
type->read(b, data);
}
if (data->version < NOBORDERATTRIBS_VERSION) { if (data->version < NOBORDERATTRIBS_VERSION) {
attrib *a = NULL; attrib *a = NULL;
int result = read_attribs(data, &a, b); int result = read_attribs(data, &a, b);
@ -675,6 +670,9 @@ int read_borders(gamedata *data)
return result; return result;
} }
} }
if (!type->write) {
log_warning("invalid border '%s' between '%s' and '%s'\n", zText, regionname(from, 0), regionname(to, 0));
}
} }
} }
return 0; return 0;