mapper: choose_terrain didn't work with only 2 terrains.

This commit is contained in:
Enno Rehling 2005-11-26 00:58:27 +00:00
parent 3524cb59d2
commit eaf1c0f447
1 changed files with 11 additions and 6 deletions

View File

@ -1032,6 +1032,7 @@ choose_terrain(terrain_t t) {
if (rand()%100 < 10) return T_OCEAN;
q = rand()%100;
switch (t) {
case T_OCEAN:
if(rand()%100 < 60) return T_OCEAN;
@ -1242,10 +1243,14 @@ create_island(region *r, int n, const struct terrain_type * terrain)
}
r2 = findregion(x,y);
if (r2 && fval(r2->terrain, SEA_REGION)) {
const terrain_type * terrain = NULL;
do {
terrain_t t = choose_terrain(oldterrain(r2->terrain));
terrain = newterrain(t);
} while (terrain==NULL);
r2->msgs = (void *)d;
push(r2);
abbruch = Create_Island(r2, &n, newterrain(t), sx, sy);
abbruch = Create_Island(r2, &n, terrain, sx, sy);
}
if (abbruch) break;
}