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