#define new_x(newx) (((newx) + WORLD_X) % WORLD_X)
#define new_y(newy) (((newy) + WORLD_Y) % WORLD_Y)
-static int secs; /* number of sectors grown */
static int ctot; /* total number of continents and islands grown */
static int *isecs; /* array of how large each island is */
{
int i, j;
- for (i = 0; i < secs; ++i) {
+ for (i = 0; i < isecs[c]; ++i) {
sectc[c][i] = 0;
for (j = 0; j < 6; ++j)
if (own[new_x(sectx[c][i] + dirx[j])][new_y(secty[c][i] + diry[j])] == -1)
return 0;
} while (next_vector(i));
}
- sectx[c][secs] = newx;
- secty[c][secs] = newy;
+ sectx[c][isecs[c]] = newx;
+ secty[c][isecs[c]] = newy;
isecs[c]++;
own[newx][newy] = c;
return 1;
{
int i, nx, ny, wat = 0;
- if (secs == 1) {
+ if (isecs[c] == 1) {
*xp = x;
*yp = y;
return;
static int
new_try(int c, int spike)
{
+ int secs = isecs[c];
int i, starti;
if (secs == 1) {
next_coast(c, x, y, &x, &y);
++coast_search;
} while (!done && coast_search < COAST_SEARCH_MAX &&
- (secs == 1 || x != sx || y != sy));
+ (isecs[c] == 1 || x != sx || y != sy));
if (!done && c < nc)
fl_status |= STATUS_NO_ROOM;
return done;
static void
grow_continents(void)
{
- int c;
+ int c, secs;
for (c = 0; c < nc; ++c) {
sectx[c][0] = capx[c];
static void
grow_islands(void)
{
- int c, x, y, isiz;
+ int c, secs, x, y, isiz;
for (c = nc; c < nc + ni; ++c) {
secs = 0;