summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-11-26 22:04:11 +0000
committersmatz <smatz@openttd.org>2009-11-26 22:04:11 +0000
commit421a24001c5629e29d04c17b0ad3e80d0498856e (patch)
treea4ced0b9ccd67551d7e532f9152ccd92bc1ed47c
parent4eccf3a5cfb066b9c9c625821aaed5b6e05ad08b (diff)
downloadopenttd-421a24001c5629e29d04c17b0ad3e80d0498856e.tar.xz
(svn r18302) -Fix [FS#3328](r18281): city size multiplier was ignored when generating new game
-rw-r--r--src/town_cmd.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 957cc2197..3789cd582 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -1402,8 +1402,9 @@ void UpdateTownMaxPass(Town *t)
* @param size Parameter for size determination
* @param city whether to build a city or town
* @param layout the (road) layout of the town
+ * @param manual was the town placed manually?
*/
-static void DoCreateTown(Town *t, TileIndex tile, uint32 townnameparts, TownSize size, bool city, TownLayout layout)
+static void DoCreateTown(Town *t, TileIndex tile, uint32 townnameparts, TownSize size, bool city, TownLayout layout, bool manual)
{
t->xy = tile;
t->num_houses = 0;
@@ -1458,7 +1459,8 @@ static void DoCreateTown(Town *t, TileIndex tile, uint32 townnameparts, TownSize
int x = (int)size * 16 + 3;
if (size == TS_RANDOM) x = (Random() & 0xF) + 8;
- if (city && _game_mode == GM_EDITOR) x *= _settings_game.economy.initial_city_size;
+ /* Don't create huge cities when founding town in-game */
+ if (city && (!manual || _game_mode == GM_EDITOR)) x *= _settings_game.economy.initial_city_size;
t->num_houses += x;
UpdateTownRadius(t);
@@ -1594,7 +1596,7 @@ CommandCost CmdFoundTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
}
} else {
t = new Town(tile);
- DoCreateTown(t, tile, townnameparts, size, city, layout);
+ DoCreateTown(t, tile, townnameparts, size, city, layout, true);
}
UpdateNearestTownForRoadTiles(false);
_generating_world = false;
@@ -1756,7 +1758,7 @@ static Town *CreateRandomTown(uint attempts, uint32 townnameparts, TownSize size
/* Allocate a town struct */
Town *t = new Town(tile);
- DoCreateTown(t, tile, townnameparts, size, city, layout);
+ DoCreateTown(t, tile, townnameparts, size, city, layout, false);
/* if the population is still 0 at the point, then the
* placement is so bad it couldn't grow at all */