summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-09-07 08:36:52 +0000
committerrubidium <rubidium@openttd.org>2009-09-07 08:36:52 +0000
commit1474be7ea7722380755c48ab1bc8b3154aa99511 (patch)
tree3b08030feac58f286e34e1a36a7df6a45738b2db
parent130781102e2627adb3b8709d878f45b6ddfa7cab (diff)
downloadopenttd-1474be7ea7722380755c48ab1bc8b3154aa99511.tar.xz
(svn r17444) -Fix [FS#3173]: when building roads isn't allowed for town, then don't build the initial piece either
-rw-r--r--src/town_cmd.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 49775798c..921a592b6 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -1315,17 +1315,19 @@ static bool GrowTown(Town *t)
/* No road available, try to build a random road block by
* clearing some land and then building a road there. */
- tile = t->xy;
- for (ptr = _town_coord_mod; ptr != endof(_town_coord_mod); ++ptr) {
- /* Only work with plain land that not already has a house */
- if (!IsTileType(tile, MP_HOUSE) && GetTileSlope(tile, NULL) == SLOPE_FLAT) {
- if (CmdSucceeded(DoCommand(tile, 0, 0, DC_AUTO | DC_NO_WATER, CMD_LANDSCAPE_CLEAR))) {
- DoCommand(tile, GenRandomRoadBits(), t->index, DC_EXEC | DC_AUTO, CMD_BUILD_ROAD);
- _current_company = old_company;
- return true;
+ if (_settings_game.economy.allow_town_roads || _generating_world) {
+ tile = t->xy;
+ for (ptr = _town_coord_mod; ptr != endof(_town_coord_mod); ++ptr) {
+ /* Only work with plain land that not already has a house */
+ if (!IsTileType(tile, MP_HOUSE) && GetTileSlope(tile, NULL) == SLOPE_FLAT) {
+ if (CmdSucceeded(DoCommand(tile, 0, 0, DC_AUTO | DC_NO_WATER, CMD_LANDSCAPE_CLEAR))) {
+ DoCommand(tile, GenRandomRoadBits(), t->index, DC_EXEC | DC_AUTO, CMD_BUILD_ROAD);
+ _current_company = old_company;
+ return true;
+ }
}
+ tile = TILE_ADD(tile, ToTileIndexDiff(*ptr));
}
- tile = TILE_ADD(tile, ToTileIndexDiff(*ptr));
}
_current_company = old_company;