crashbug missing volcano_terrain

This commit is contained in:
Enno Rehling 2005-12-11 15:14:03 +00:00
parent 5cf53c332a
commit d51b277d8a
2 changed files with 4 additions and 3 deletions

View File

@ -483,6 +483,7 @@ autoseed(newfaction ** players, int nsize, boolean new_island)
int rsize, tsize = 0; int rsize, tsize = 0;
int isize = REGIONS_PER_FACTION; /* target size for the island */ int isize = REGIONS_PER_FACTION; /* target size for the island */
int psize = 0; /* players on this island */ int psize = 0; /* players on this island */
const terrain_type * volcano_terrain = get_terrain("volcano");
if (listlen(*players)<MINFACTIONS) return 0; if (listlen(*players)<MINFACTIONS) return 0;
@ -593,8 +594,8 @@ autoseed(newfaction ** players, int nsize, boolean new_island)
++rsize; ++rsize;
} }
} }
if (rand() % VOLCANO_CHANCE == 0) { if (volcano_terrain!=NULL && (rand() % VOLCANO_CHANCE == 0)) {
terraform(r, T_VOLCANO); terraform_region(r, volcano_terrain);
} else if (nsize && (rand() % isize == 0 || rsize==0)) { } else if (nsize && (rand() % isize == 0 || rsize==0)) {
newfaction ** nfp, * nextf = *players; newfaction ** nfp, * nextf = *players;
faction * f; faction * f;

View File

@ -173,7 +173,7 @@ race_setscript(const char * rcname, const luabind::object& f)
} }
#define ISLANDSIZE 20 #define ISLANDSIZE 20
#define TURNS_PER_ISLAND 3 #define TURNS_PER_ISLAND 4
static void static void
lua_autoseed(const char * filename, bool new_island) lua_autoseed(const char * filename, bool new_island)
{ {