summaryrefslogtreecommitdiff
path: root/src/town_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-02-06 20:42:09 +0000
committerrubidium <rubidium@openttd.org>2014-02-06 20:42:09 +0000
commit30a95966ecb1d6f88a7a789ff1aaee442241c84c (patch)
treedb6e4ce84cb628734278a443ac07580a5f60ad9e /src/town_cmd.cpp
parent96030141026ded3f892510ff9e3643319f27ebd8 (diff)
downloadopenttd-30a95966ecb1d6f88a7a789ff1aaee442241c84c.tar.xz
(svn r26308) -Fix-ish: do not try to build more towns/industries than the pool can hold (MJP)
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r--src/town_cmd.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index b6cd19bc2..d9843866c 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -1880,6 +1880,7 @@ bool GenerateTowns(TownLayout layout)
uint current_number = 0;
uint difficulty = (_game_mode != GM_EDITOR) ? _settings_game.difficulty.number_towns : 0;
uint total = (difficulty == (uint)CUSTOM_TOWN_NUMBER_DIFFICULTY) ? _settings_game.game_creation.custom_town_number : ScaleByMapSize(_num_initial_towns[difficulty] + (Random() & 7));
+ total = min(TownPool::MAX_SIZE, total);
uint32 townnameparts;
SetGeneratingWorldProgress(GWP_TOWN, total);