mirror of https://github.com/OpenTTD/OpenTTD
(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)release/0.4.5
parent
2bd8df54e1
commit
cc8fc19d4a
|
@ -966,13 +966,6 @@ static void TileLoop_Road(uint tile)
|
||||||
|
|
||||||
grp = 0;
|
grp = 0;
|
||||||
if (t != NULL) {
|
if (t != NULL) {
|
||||||
/* In SE, set the owner to OWNER_TOWN */
|
|
||||||
if (_game_mode == GM_EDITOR && _map_owner[tile] != OWNER_TOWN) {
|
|
||||||
_map_owner[tile] = OWNER_TOWN;
|
|
||||||
/* XXX - This line is not perfect, any suggestions? */
|
|
||||||
_map2[tile] = ClosestTownFromTile(tile, (uint)-1)->index;
|
|
||||||
}
|
|
||||||
|
|
||||||
grp = GetTownRadiusGroup(t, tile);
|
grp = GetTownRadiusGroup(t, tile);
|
||||||
|
|
||||||
// Show an animation to indicate road work
|
// Show an animation to indicate road work
|
||||||
|
|
14
town_cmd.c
14
town_cmd.c
|
@ -729,9 +729,17 @@ static int GrowTownAtRoad(Town *t, uint tile)
|
||||||
do block = Random() & 3; while (!HASBIT(mask,block));
|
do block = Random() & 3; while (!HASBIT(mask,block));
|
||||||
tile += ToTileIndexDiff(_roadblock_tileadd[block]);
|
tile += ToTileIndexDiff(_roadblock_tileadd[block]);
|
||||||
|
|
||||||
/* Don't allow building over roads of other cities */
|
if (IsTileType(tile, MP_STREET)) {
|
||||||
if (IsTileType(tile, MP_STREET) && _map_owner[tile] == OWNER_TOWN && GetTown(_map2[tile]) != t)
|
/* Don't allow building over roads of other cities */
|
||||||
_grow_town_result = -1;
|
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.
|
// Max number of times is checked.
|
||||||
} while (--_grow_town_result >= 0);
|
} while (--_grow_town_result >= 0);
|
||||||
|
|
Loading…
Reference in New Issue