forked from github/server
verbesserte Korrektur-Routine
This commit is contained in:
parent
df94b39f8c
commit
8e508a9e99
|
@ -1060,15 +1060,23 @@ fix_familiars(void)
|
||||||
static int
|
static int
|
||||||
fix_resources(void)
|
fix_resources(void)
|
||||||
{
|
{
|
||||||
|
boolean started = false;
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
region * r;
|
region * r;
|
||||||
|
|
||||||
for (r=regions;r;r=r->next) {
|
for (r=regions;r;r=r->next) {
|
||||||
if (r->terrain->production!=NULL && r->resources==NULL) {
|
if (r->terrain->production!=NULL && r->resources==NULL) {
|
||||||
terraform_resources(r);
|
if (!started) {
|
||||||
if (r->resources!=NULL) {
|
terrain_production * prod = r->terrain->production;
|
||||||
log_warning(("fixing resources in '%s'\n", regionname(r, NULL)));
|
while (prod->type && prod->chance<1.0) ++prod;
|
||||||
retval = -1;
|
if (prod->type) started = true;
|
||||||
|
}
|
||||||
|
if (started) {
|
||||||
|
terraform_resources(r);
|
||||||
|
if (r->resources!=NULL) {
|
||||||
|
log_warning(("fixing resources in '%s'\n", regionname(r, NULL)));
|
||||||
|
retval = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue