forked from github/server
Better version of the ocean-age fixes produces proper firewalls around the
world
This commit is contained in:
parent
d09071eff7
commit
b7ebf40866
2 changed files with 20 additions and 6 deletions
|
@ -887,7 +887,10 @@ demographics(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (r = regions; r; r = r->next) {
|
for (r = regions; r; r = r->next) {
|
||||||
|
if (r->age>0 || rterrain(r)!=T_OCEAN) {
|
||||||
|
/* oceans get their initial age in frame_regions() */
|
||||||
++r->age;
|
++r->age;
|
||||||
|
}
|
||||||
live(r);
|
live(r);
|
||||||
/* check_split_dragons(); */
|
/* check_split_dragons(); */
|
||||||
|
|
||||||
|
|
|
@ -749,14 +749,25 @@ fix_gates(void)
|
||||||
static void
|
static void
|
||||||
frame_regions(void)
|
frame_regions(void)
|
||||||
{
|
{
|
||||||
unsigned short page = turn;
|
unsigned short ocean_age = turn;
|
||||||
region * r = regions;
|
region * r = regions;
|
||||||
for (r=regions;r;r=r->next) {
|
for (r=regions;r;r=r->next) {
|
||||||
direction_t d;
|
direction_t d;
|
||||||
if (rterrain(r) == T_OCEAN && r->age+1<page) {
|
if (rterrain(r) == T_OCEAN && r->age==0) {
|
||||||
r->age = page;
|
unsigned short age = 0;
|
||||||
} else if (r->age<page) {
|
direction_t d;
|
||||||
page = r->age;
|
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;
|
if (r->age<16) continue;
|
||||||
|
|
Loading…
Reference in a new issue