Merge branch 'master' into jgrpp
# Conflicts: # src/3rdparty/fmt/core.h # src/command_type.h # src/console_cmds.cpp # src/core/overflowsafe_type.hpp # src/landscape.cpp # src/network/network.cpp # src/newgrf_object.h # src/object_cmd.cpp # src/order_gui.cpp # src/saveload/vehicle_sl.cpp # src/script/api/script_industrytype.cpp # src/script/api/script_object.hpp # src/script/api/script_town.cpp # src/table/object_land.h # src/timetable_cmd.cpp # src/tree_cmd.cpp # src/vehicle_gui.cpp # src/window.cpp
This commit is contained in:
@@ -112,11 +112,12 @@ bool VerifyTownName(uint32 r, const TownNameParams *par, TownNames *town_names)
|
||||
|
||||
/**
|
||||
* Generates valid town name.
|
||||
* @param randomizer the source of random data for generating the name
|
||||
* @param townnameparts if a name is generated, it's stored there
|
||||
* @param town_names if a name is generated, check its uniqueness with the set
|
||||
* @return true iff a name was generated
|
||||
*/
|
||||
bool GenerateTownName(uint32 *townnameparts, TownNames *town_names)
|
||||
bool GenerateTownName(Randomizer &randomizer, uint32 *townnameparts, TownNames *town_names)
|
||||
{
|
||||
TownNameParams par(_settings_game.game_creation.town_name);
|
||||
|
||||
@@ -130,7 +131,7 @@ bool GenerateTownName(uint32 *townnameparts, TownNames *town_names)
|
||||
* the other towns may take considerable amount of time (10000 is
|
||||
* too much). */
|
||||
for (int i = 1000; i != 0; i--) {
|
||||
uint32 r = _generating_world ? Random() : InteractiveRandom();
|
||||
uint32 r = randomizer.Next();
|
||||
if (!VerifyTownName(r, &par, town_names)) continue;
|
||||
|
||||
*townnameparts = r;
|
||||
|
Reference in New Issue
Block a user