Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #11164: Duplicate town names when using the many random towns function #11165

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/town_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2256,6 +2256,11 @@ bool GenerateTowns(TownLayout layout)

SetGeneratingWorldProgress(GWP_TOWN, total);

/* Pre-populate the town names list with the names of any towns already on the map */
for (const Town *town : Town::Iterate()) {
town_names.insert(town->GetCachedName());
}

/* First attempt will be made at creating the suggested number of towns.
* Note that this is really a suggested value, not a required one.
* We would not like the system to lock up just because the user wanted 100 cities on a 64*64 map, would we? */
Expand Down