Codechange: pass the randomizer directly to the town name generation
This commit is contained in:
@@ -2245,7 +2245,7 @@ bool GenerateTowns(TownLayout layout)
|
||||
bool city = (_settings_game.economy.larger_towns != 0 && Chance16(1, _settings_game.economy.larger_towns));
|
||||
IncreaseGeneratingWorldProgress(GWP_TOWN);
|
||||
/* Get a unique name for the town. */
|
||||
if (!GenerateTownName(&townnameparts, &town_names)) continue;
|
||||
if (!GenerateTownName(_random, &townnameparts, &town_names)) continue;
|
||||
/* try 20 times to create a random-sized town for the first loop. */
|
||||
if (CreateRandomTown(20, townnameparts, TSZ_RANDOM, city, layout) != nullptr) current_number++; // If creation was successful, raise a flag.
|
||||
} while (--total);
|
||||
@@ -2259,7 +2259,7 @@ bool GenerateTowns(TownLayout layout)
|
||||
|
||||
/* If current_number is still zero at this point, it means that not a single town has been created.
|
||||
* So give it a last try, but now more aggressive */
|
||||
if (GenerateTownName(&townnameparts) &&
|
||||
if (GenerateTownName(_random, &townnameparts) &&
|
||||
CreateRandomTown(10000, townnameparts, TSZ_RANDOM, _settings_game.economy.larger_towns != 0, layout) != nullptr) {
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user