summaryrefslogtreecommitdiff
path: root/src/town_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-03-03 22:46:08 +0000
committerrubidium <rubidium@openttd.org>2009-03-03 22:46:08 +0000
commitf1a96c557726899caea40b94c8e3a8d168c98788 (patch)
tree0e72237b616a3462e3d0c5ebd0974766dfc9a094 /src/town_cmd.cpp
parentb55ed2e6685a675064cd489132f611897344ca47 (diff)
downloadopenttd-f1a96c557726899caea40b94c8e3a8d168c98788.tar.xz
(svn r15604) -Fix [FS#2661]: towns would only build houses where the grid would not be, even when they aren't allowed to build roads and the user 'implements' another layout.
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r--src/town_cmd.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 6039d1040..fdb846936 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -1800,6 +1800,9 @@ static bool CheckFree2x2Area(TileIndex tile, TownID town, uint z, bool noslope)
*/
static inline bool TownLayoutAllowsHouseHere(Town *t, TileIndex tile)
{
+ /* Allow towns everywhere when we don't build roads */
+ if (!_settings_game.economy.allow_town_roads && !_generating_world) return true;
+
TileIndexDiffC grid_pos = TileIndexToTileIndexDiffC(t->xy, tile);
switch (t->layout) {
@@ -1828,6 +1831,9 @@ static inline bool TownLayoutAllowsHouseHere(Town *t, TileIndex tile)
*/
static inline bool TownLayoutAllows2x2HouseHere(Town *t, TileIndex tile)
{
+ /* Allow towns everywhere when we don't build roads */
+ if (!_settings_game.economy.allow_town_roads && !_generating_world) return true;
+
/* MapSize() is sure dividable by both MapSizeX() and MapSizeY(),
* so to do only one memory access, use MapSize() */
uint dx = MapSize() + TileX(t->xy) - TileX(tile);