From b7ebf40866867ab9036e0b7a1b6c7564e8fad09c Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 3 Sep 2005 07:50:00 +0000 Subject: [PATCH] Better version of the ocean-age fixes produces proper firewalls around the world --- src/common/gamecode/laws.c | 5 ++++- src/eressea/korrektur.c | 21 ++++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/common/gamecode/laws.c b/src/common/gamecode/laws.c index 7c7f1457c..3a4e4f6c5 100644 --- a/src/common/gamecode/laws.c +++ b/src/common/gamecode/laws.c @@ -887,7 +887,10 @@ demographics(void) #endif for (r = regions; r; r = r->next) { - ++r->age; + if (r->age>0 || rterrain(r)!=T_OCEAN) { + /* oceans get their initial age in frame_regions() */ + ++r->age; + } live(r); /* check_split_dragons(); */ diff --git a/src/eressea/korrektur.c b/src/eressea/korrektur.c index 6a2a5251d..041d77e33 100644 --- a/src/eressea/korrektur.c +++ b/src/eressea/korrektur.c @@ -749,14 +749,25 @@ fix_gates(void) static void frame_regions(void) { - unsigned short page = turn; + unsigned short ocean_age = turn; region * r = regions; for (r=regions;r;r=r->next) { direction_t d; - if (rterrain(r) == T_OCEAN && r->age+1age = page; - } else if (r->ageage; + if (rterrain(r) == T_OCEAN && r->age==0) { + unsigned short age = 0; + direction_t d; + for (d=0;d!=MAXDIRECTIONS;++d) { + region * rn = rconnect(r, d); + if (rn && rn->age>age) { + age = rn->age; + } + } + if (age!=0 && age < ocean_age) { + ocean_age = age; + } + r->age = ocean_age; + } else if (r->age>ocean_age) { + ocean_age = r->age; } if (r->age<16) continue;