summaryrefslogtreecommitdiff
path: root/town_cmd.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-02-06 20:29:32 +0000
committertruelight <truelight@openttd.org>2005-02-06 20:29:32 +0000
commitcc8fc19d4a1caab042a1b545f37eead2ff62f5ff (patch)
treedea5801b5c91bbc69b9d02ecad98640ac1b0e031 /town_cmd.c
parent2bd8df54e1ca6e7aff9df44b8f98665aadbe2596 (diff)
downloadopenttd-cc8fc19d4a1caab042a1b545f37eead2ff62f5ff.tar.xz
(svn r1831) -Fix: Scenario Editor now handles human-made roads better (try to build
a city layout before placing the city, finally that works very nice)
Diffstat (limited to 'town_cmd.c')
-rw-r--r--town_cmd.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/town_cmd.c b/town_cmd.c
index 7c9737a05..0c7a16756 100644
--- a/town_cmd.c
+++ b/town_cmd.c
@@ -729,9 +729,17 @@ static int GrowTownAtRoad(Town *t, uint tile)
do block = Random() & 3; while (!HASBIT(mask,block));
tile += ToTileIndexDiff(_roadblock_tileadd[block]);
- /* Don't allow building over roads of other cities */
- if (IsTileType(tile, MP_STREET) && _map_owner[tile] == OWNER_TOWN && GetTown(_map2[tile]) != t)
- _grow_town_result = -1;
+ if (IsTileType(tile, MP_STREET)) {
+ /* Don't allow building over roads of other cities */
+ if (_map_owner[tile] == OWNER_TOWN && GetTown(_map2[tile]) != t)
+ _grow_town_result = -1;
+ else if (_game_mode == GM_EDITOR) {
+ /* If we are in the SE, and this road-piece has no town owner yet, it just found an
+ * owner :) (happy happy happy road now) */
+ _map_owner[tile] = OWNER_TOWN;
+ _map2[tile] = t->index;
+ }
+ }
// Max number of times is checked.
} while (--_grow_town_result >= 0);