summaryrefslogtreecommitdiff
path: root/src/town_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-05-20 19:14:08 +0000
committerrubidium <rubidium@openttd.org>2007-05-20 19:14:08 +0000
commitd86b5e5e9328e85faa1bf97615b8c796fc874863 (patch)
tree040143187639f8855d9618bfc8f784f4a42bbaeb /src/town_cmd.cpp
parentc685a7179f58e8df5e64b424d4f320723e07b65c (diff)
downloadopenttd-d86b5e5e9328e85faa1bf97615b8c796fc874863.tar.xz
(svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r--src/town_cmd.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 03248a9bb..39765e25d 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -636,7 +636,7 @@ void OnTick_Town()
static RoadBits GetTownRoadMask(TileIndex tile)
{
- TrackBits b = GetAnyRoadTrackBits(tile);
+ TrackBits b = GetAnyRoadTrackBits(tile, ROADTYPE_ROAD);
RoadBits r = ROAD_NONE;
if (b & TRACK_BIT_X) r |= ROAD_X;
@@ -676,7 +676,7 @@ static bool IsRoadAllowedHere(TileIndex tile, int dir)
for (;;) {
/* Check if there already is a road at this point? */
- if (GetAnyRoadTrackBits(tile) == 0) {
+ if (GetAnyRoadTrackBits(tile, ROADTYPE_ROAD) == 0) {
/* No, try to build one in the direction.
* if that fails clear the land, and if that fails exit.
* This is to make sure that we can build a road here later. */
@@ -1221,7 +1221,7 @@ static bool GrowTown(Town *t)
/* Find a road that we can base the construction on. */
tile = t->xy;
for (ptr = _town_coord_mod; ptr != endof(_town_coord_mod); ++ptr) {
- if (GetAnyRoadTrackBits(tile) != 0) {
+ if (GetAnyRoadTrackBits(tile, ROADTYPE_ROAD) != 0) {
int r = GrowTownAtRoad(t, tile);
_current_player = old_player;
return r != 0;
@@ -2208,7 +2208,7 @@ Town *ClosestTownFromTile(TileIndex tile, uint threshold)
{
if (IsTileType(tile, MP_HOUSE) || (
IsTileType(tile, MP_STREET) &&
- (IsLevelCrossing(tile) ? GetCrossingRoadOwner(tile) : GetTileOwner(tile)) == OWNER_TOWN
+ GetRoadOwner(tile, ROADTYPE_ROAD) == OWNER_TOWN
)) {
return GetTownByTile(tile);
} else {