From 18153f56149afc2d610ce219f7874f2a52e53fa1 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 19 Dec 2005 18:56:20 +0000 Subject: [PATCH] =?UTF-8?q?http://eressea.upb.de/mantis/view.php=3Fid=3D77?= =?UTF-8?q?5=20Es=20gibt=20auch=20noch=20=C3=A4ltere=20Berge=20und=20Glets?= =?UTF-8?q?cher=20ohne=20Eisen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/eressea/korrektur.c | 28 +++++++++++++++++++--------- src/res/terrains.xml | 8 ++++---- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/eressea/korrektur.c b/src/eressea/korrektur.c index e7c392278..5213b8a7a 100644 --- a/src/eressea/korrektur.c +++ b/src/eressea/korrektur.c @@ -1060,24 +1060,34 @@ fix_familiars(void) static int fix_resources(void) { - boolean started = false; int retval = 0; - region * r; + region * r, * start = NULL; for (r=regions;r;r=r->next) { - if (r->terrain->production!=NULL && r->resources==NULL) { - if (!started) { + if (r->resources==NULL) { + if (r->terrain->production!=NULL) { terrain_production * prod = r->terrain->production; while (prod->type && prod->chance<1.0) ++prod; - if (prod->type) started = true; - } - if (started) { - terraform_resources(r); - if (r->resources!=NULL) { + + if (prod->type!=NULL) { + terraform_resources(r); log_warning(("fixing resources in '%s'\n", regionname(r, NULL))); retval = -1; + if (start==NULL) start = r->next; } } + } else { + start = NULL; + } + } + + for (r=start;r;r=r->next) { + if (r->resources==NULL) { + if (r->terrain->production!=NULL) { + terraform_resources(r); + log_warning(("fixing resources in '%s'\n", regionname(r, NULL))); + retval = -1; + } } } return retval; diff --git a/src/res/terrains.xml b/src/res/terrains.xml index 1930cb039..9753534e0 100644 --- a/src/res/terrains.xml +++ b/src/res/terrains.xml @@ -64,8 +64,8 @@ - - + + @@ -73,8 +73,8 @@ - - + +