From 1b19e8d19c7fbb568382209c6cec28f57648cab5 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 16 Sep 2017 08:42:49 +0200 Subject: [PATCH] =?UTF-8?q?BUG=202365:=20Ozeane=20sollen=20keine=20Beschre?= =?UTF-8?q?ibung=20haben=20k=C3=B6nnen.=20https://trello.com/c/GSeHT8t6/61?= =?UTF-8?q?8-why-r-display-not-r-land-display?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/kernel/save.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/kernel/save.c b/src/kernel/save.c index a719cb17b..94a25c07e 100644 --- a/src/kernel/save.c +++ b/src/kernel/save.c @@ -885,19 +885,15 @@ void write_unit(gamedata *data, const unit * u) WRITE_SECTION(data->store); } -static void read_regioninfo(gamedata *data, region *r) { +static void read_regioninfo(gamedata *data, const region *r, char *info) { if (lomem) { READ_STR(data->store, NULL, 0); } else { - char info[DISPLAYSIZE]; READ_STR(data->store, info, sizeof(info)); if (unicode_utf8_trim(info) != 0) { log_warning("trim region %d info to '%s'", r->uid, info); } - if (r->land) { - region_setinfo(r, info); - } } } @@ -906,6 +902,7 @@ static region *readregion(gamedata *data, int x, int y) region *r = findregion(x, y); const terrain_type *terrain; char name[NAMESIZE]; + char info[DISPLAYSIZE]; int uid = 0; int n; @@ -932,7 +929,7 @@ static region *readregion(gamedata *data, int x, int y) r->land = 0; } if (data->version < LANDDISPLAY_VERSION) { - read_regioninfo(data, r); + read_regioninfo(data, r, info); } READ_STR(data->store, name, sizeof(name)); @@ -959,8 +956,9 @@ static region *readregion(gamedata *data, int x, int y) rawmaterial **pres = &r->resources; if (data->version >= LANDDISPLAY_VERSION) { - read_regioninfo(data, r); + read_regioninfo(data, r, info); } + region_setinfo(r, info); READ_INT(data->store, &i); if (i < 0) { log_error("number of trees in %s is %d.", regionname(r, NULL), i); @@ -1038,7 +1036,11 @@ static region *readregion(gamedata *data, int x, int y) READ_INT(data->store, &n); rsetmoney(r, n); } - + else { + if (info[0]) { + log_error("%s %d has a description: %s", r->terrain->_name, r->uid, info); + } + } assert(r->terrain != NULL); if (r->land) { @@ -1759,6 +1761,9 @@ int read_game(gamedata *data) /* Burgen */ READ_INT(store, &p); + if (p > 0 && !r->land) { + log_error("%s, uid=%d has %d buildings", regionname(r, NULL), r->uid, p); + } bp = &r->buildings; while (--p >= 0) {