From 822292c99a68a235925dd6381be55e4c2c3358c8 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 27 Jul 2017 16:16:54 +0200 Subject: [PATCH] do not seed factions when creating islands with 'B'. --- src/gmtool.c | 2 +- src/modules/autoseed.c | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/gmtool.c b/src/gmtool.c index 6db857ad9..3e33203ce 100644 --- a/src/gmtool.c +++ b/src/gmtool.c @@ -920,7 +920,7 @@ static void handlekey(state * st, int c) else { n = minpop; } - build_island_e3(&new_players, nx, ny, n, n * 3); + build_island_e3(NULL, nx, ny, n, n * 3); st->modified = 1; st->wnd_info->update |= 1; st->wnd_status->update |= 1; diff --git a/src/modules/autoseed.c b/src/modules/autoseed.c index ffab4ca46..6ec945a09 100644 --- a/src/modules/autoseed.c +++ b/src/modules/autoseed.c @@ -784,13 +784,15 @@ const terrain_type * (*terraformer) (direction_t)) direction_t dir; for (dir = 0; dir != MAXDIRECTIONS; ++dir) { region *rn = rconnect(r, dir); - if (rn == NULL) { + if (rn == NULL || !rn->land) { const terrain_type *terrain = terraformer(dir); - plane *pl = rplane(r); - int x = r->x + delta_x[dir]; - int y = r->y + delta_y[dir]; - pnormalize(&x, &y, pl); - rn = new_region(x, y, pl, 0); + if (!rn) { + plane *pl = rplane(r); + int x = r->x + delta_x[dir]; + int y = r->y + delta_y[dir]; + pnormalize(&x, &y, pl); + rn = new_region(x, y, pl, 0); + } terraform_region(rn, terrain); regionqueue_push(rlist, rn); if (rn->land) { @@ -946,7 +948,7 @@ int build_island_e3(newfaction ** players, int x, int y, int numfactions, int mi get_neighbours(r, rn); q = region_quality(r, rn); - if (q >= MIN_QUALITY && nfactions < numfactions && *players) { + if (q >= MIN_QUALITY && nfactions < numfactions && players && *players) { starting_region(players, r, rn); minq = MIN(minq, q); maxq = MAX(maxq, q); @@ -961,7 +963,7 @@ int build_island_e3(newfaction ** players, int x, int y, int numfactions, int mi region *rn[MAXDIRECTIONS]; get_neighbours(r, rn); q = region_quality(r, rn); - if (q >= MIN_QUALITY * 4 / 3 && nfactions < numfactions && *players) { + if (q >= MIN_QUALITY * 4 / 3 && nfactions < numfactions && players && *players) { starting_region(players, r, rn); minq = MIN(minq, q); maxq = MAX(maxq, q);