Codechange: pass the randomizer directly to the town name generation

This commit is contained in:
Rubidium
2023-01-13 22:31:09 +01:00
committed by rubidium42
parent b3b8c3fd2d
commit 3373128233
6 changed files with 10 additions and 7 deletions

View File

@@ -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;
}