summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ai/default/default.cpp14
-rw-r--r--src/ai/trolly/build.cpp2
-rw-r--r--src/ai/trolly/pathfinder.cpp6
-rw-r--r--src/ai/trolly/trolly.cpp4
-rw-r--r--src/bridge_map.h2
-rw-r--r--src/depot.h2
-rw-r--r--src/elrail.cpp4
-rw-r--r--src/npf.cpp8
-rw-r--r--src/openttd.cpp12
-rw-r--r--src/order_gui.cpp2
-rw-r--r--src/rail.cpp2
-rw-r--r--src/rail_cmd.cpp8
-rw-r--r--src/road_cmd.cpp12
-rw-r--r--src/road_gui.cpp2
-rw-r--r--src/road_map.cpp4
-rw-r--r--src/road_map.h18
-rw-r--r--src/roadveh_cmd.cpp16
-rw-r--r--src/smallmap_gui.cpp2
-rw-r--r--src/station_cmd.cpp2
-rw-r--r--src/tile.h4
-rw-r--r--src/town_cmd.cpp6
-rw-r--r--src/town_map.h10
-rw-r--r--src/tunnelbridge_cmd.cpp2
-rw-r--r--src/yapf/yapf_costrail.hpp2
-rw-r--r--src/yapf/yapf_road.cpp4
25 files changed, 75 insertions, 75 deletions
diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp
index a47e91fce..5df2b5930 100644
--- a/src/ai/default/default.cpp
+++ b/src/ai/default/default.cpp
@@ -1691,7 +1691,7 @@ clear_town_stuff:;
/* signals too? */
if (j & 3) {
// Can't build signals on a road.
- if (IsTileType(c, MP_STREET)) return CMD_ERROR;
+ if (IsTileType(c, MP_ROAD)) return CMD_ERROR;
if (flag & DC_EXEC) {
j = 4 - j;
@@ -2044,7 +2044,7 @@ static inline void AiCheckBuildRailBridgeHere(AiRailFinder *arf, TileIndex tile,
if (!flag) return;
break;
}
- if (type != MP_WATER && type != MP_RAILWAY && type != MP_STREET) return;
+ if (type != MP_WATER && type != MP_RAILWAY && type != MP_ROAD) return;
flag = true;
}
@@ -2639,7 +2639,7 @@ static CommandCost AiDoBuildDefaultRoadBlock(TileIndex tile, const AiDefaultBloc
_cleared_town = NULL;
if (p->mode == 2) {
- if (IsTileType(c, MP_STREET) &&
+ if (IsTileType(c, MP_ROAD) &&
GetRoadTileType(c) == ROAD_TILE_NORMAL &&
(GetRoadBits(c, ROADTYPE_ROAD) & p->attr) != 0) {
roadflag |= 2;
@@ -2682,7 +2682,7 @@ clear_town_stuff:;
if (GetTileSlope(c, NULL) != SLOPE_FLAT) return CMD_ERROR;
- if (!IsTileType(c, MP_STREET) || GetRoadTileType(c) != ROAD_TILE_NORMAL) {
+ if (!IsTileType(c, MP_ROAD) || GetRoadTileType(c) != ROAD_TILE_NORMAL) {
ret = DoCommand(c, 0, 0, flag | DC_AUTO | DC_NO_WATER | DC_AI_BUILDING, CMD_LANDSCAPE_CLEAR);
if (CmdFailed(ret)) return CMD_ERROR;
}
@@ -2857,7 +2857,7 @@ static bool AiEnumFollowRoad(TileIndex tile, AiRoadEnum *a, int track, uint leng
if (dist <= a->best_dist) {
TileIndex tile2 = TILE_MASK(tile + TileOffsByDiagDir(_dir_by_track[track]));
- if (IsTileType(tile2, MP_STREET) && GetRoadTileType(tile2) == ROAD_TILE_NORMAL) {
+ if (IsTileType(tile2, MP_ROAD) && GetRoadTileType(tile2) == ROAD_TILE_NORMAL) {
a->best_dist = dist;
a->best_tile = tile;
a->best_track = track;
@@ -2945,7 +2945,7 @@ static inline void AiCheckBuildRoadBridgeHere(AiRoadFinder *arf, TileIndex tile,
if (!flag) return;
break;
}
- if (type != MP_WATER && type != MP_RAILWAY && type != MP_STREET) return;
+ if (type != MP_WATER && type != MP_RAILWAY && type != MP_ROAD) return;
flag = true;
}
@@ -3726,7 +3726,7 @@ pos_3:
DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
}
- } else if (IsTileType(tile, MP_STREET)) {
+ } else if (IsTileType(tile, MP_ROAD)) {
if (!IsTileOwner(tile, _current_player)) return;
if (IsLevelCrossing(tile)) goto is_rail_crossing;
diff --git a/src/ai/trolly/build.cpp b/src/ai/trolly/build.cpp
index 41c80529c..6d5e9a32f 100644
--- a/src/ai/trolly/build.cpp
+++ b/src/ai/trolly/build.cpp
@@ -199,7 +199,7 @@ CommandCost AiNew_Build_RoutePart(Player *p, Ai_PathFinderInfo *PathFinderInfo,
// Build the tile
res = AI_DoCommand(route[part], dir, 0, flag | DC_NO_WATER, CMD_BUILD_ROAD);
// Currently, we ignore CMD_ERRORs!
- if (CmdFailed(res) && flag == DC_EXEC && !IsTileType(route[part], MP_STREET) && !EnsureNoVehicle(route[part])) {
+ if (CmdFailed(res) && flag == DC_EXEC && !IsTileType(route[part], MP_ROAD) && !EnsureNoVehicle(route[part])) {
// Problem.. let's just abort it all!
DEBUG(ai, 0, "[BuidPath] route building failed at tile 0x%X, aborting", route[part]);
p->ainew.state = AI_STATE_NOTHING;
diff --git a/src/ai/trolly/pathfinder.cpp b/src/ai/trolly/pathfinder.cpp
index bea1858f1..7277cf4c2 100644
--- a/src/ai/trolly/pathfinder.cpp
+++ b/src/ai/trolly/pathfinder.cpp
@@ -41,8 +41,8 @@ static bool TestCanBuildStationHere(TileIndex tile, byte dir)
static bool IsRoad(TileIndex tile)
{
return
- // MP_STREET, but not a road depot?
- (IsTileType(tile, MP_STREET) && !IsTileDepotType(tile, TRANSPORT_ROAD)) ||
+ // MP_ROAD, but not a road depot?
+ (IsTileType(tile, MP_ROAD) && !IsTileDepotType(tile, TRANSPORT_ROAD)) ||
(IsTileType(tile, MP_TUNNELBRIDGE) && (
(IsTunnel(tile) && GetTunnelTransportType(tile) == TRANSPORT_ROAD) ||
(IsBridge(tile) && GetBridgeTransportType(tile) == TRANSPORT_ROAD)
@@ -319,7 +319,7 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
// Bridges can only be build on land that is not flat
// And if there is a road or rail blocking
if (tileh != SLOPE_FLAT ||
- (PathFinderInfo->rail_or_road && IsTileType(tile + TileOffsByDiagDir(dir), MP_STREET)) ||
+ (PathFinderInfo->rail_or_road && IsTileType(tile + TileOffsByDiagDir(dir), MP_ROAD)) ||
(!PathFinderInfo->rail_or_road && IsTileType(tile + TileOffsByDiagDir(dir), MP_RAILWAY))) {
for (;;) {
new_tile += TileOffsByDiagDir(dir);
diff --git a/src/ai/trolly/trolly.cpp b/src/ai/trolly/trolly.cpp
index 36cb793da..eb79d6f5e 100644
--- a/src/ai/trolly/trolly.cpp
+++ b/src/ai/trolly/trolly.cpp
@@ -800,7 +800,7 @@ static void AiNew_State_FindDepot(Player *p)
for (j = DIAGDIR_BEGIN; j < DIAGDIR_END; j++) {
TileIndex t = tile + TileOffsByDiagDir(j);
- if (IsTileType(t, MP_STREET) &&
+ if (IsTileType(t, MP_ROAD) &&
GetRoadTileType(t) == ROAD_TILE_DEPOT &&
IsTileOwner(t, _current_player) &&
GetRoadDepotDirection(t) == ReverseDiagDir(j)) {
@@ -1101,7 +1101,7 @@ static void AiNew_State_BuildDepot(Player *p)
CommandCost res;
assert(p->ainew.state == AI_STATE_BUILD_DEPOT);
- if (IsTileType(p->ainew.depot_tile, MP_STREET) && GetRoadTileType(p->ainew.depot_tile) == ROAD_TILE_DEPOT) {
+ if (IsTileType(p->ainew.depot_tile, MP_ROAD) && GetRoadTileType(p->ainew.depot_tile) == ROAD_TILE_DEPOT) {
if (IsTileOwner(p->ainew.depot_tile, _current_player)) {
// The depot is already built
p->ainew.state = AI_STATE_BUILD_VEHICLE;
diff --git a/src/bridge_map.h b/src/bridge_map.h
index 062bfc0c8..9f48c9238 100644
--- a/src/bridge_map.h
+++ b/src/bridge_map.h
@@ -46,7 +46,7 @@ static inline bool MayHaveBridgeAbove(TileIndex t)
return
IsTileType(t, MP_CLEAR) ||
IsTileType(t, MP_RAILWAY) ||
- IsTileType(t, MP_STREET) ||
+ IsTileType(t, MP_ROAD) ||
IsTileType(t, MP_WATER) ||
IsTileType(t, MP_TUNNELBRIDGE) ||
IsTileType(t, MP_UNMOVABLE);
diff --git a/src/depot.h b/src/depot.h
index 300423ad7..17e951358 100644
--- a/src/depot.h
+++ b/src/depot.h
@@ -74,7 +74,7 @@ static inline bool IsTileDepotType(TileIndex tile, TransportType type)
return IsTileType(tile, MP_RAILWAY) && GetRailTileType(tile) == RAIL_TILE_DEPOT;
case TRANSPORT_ROAD:
- return IsTileType(tile, MP_STREET) && GetRoadTileType(tile) == ROAD_TILE_DEPOT;
+ return IsTileType(tile, MP_ROAD) && GetRoadTileType(tile) == ROAD_TILE_DEPOT;
case TRANSPORT_WATER:
return IsTileType(tile, MP_WATER) && GetWaterTileType(tile) == WATER_TILE_DEPOT;
diff --git a/src/elrail.cpp b/src/elrail.cpp
index 69aa9259f..160f32150 100644
--- a/src/elrail.cpp
+++ b/src/elrail.cpp
@@ -102,7 +102,7 @@ static TrackBits GetRailTrackBitsUniversal(TileIndex t, byte *override)
return AxisToTrackBits(DiagDirToAxis(GetBridgeRampDirection(t)));
}
- case MP_STREET:
+ case MP_ROAD:
if (GetRoadTileType(t) != ROAD_TILE_CROSSING) return TRACK_BIT_NONE;
if (GetRailType(t) != RAILTYPE_ELECTRIC) return TRACK_BIT_NONE;
return GetCrossingRailBits(t);
@@ -393,7 +393,7 @@ void DrawCatenary(const TileInfo *ti)
break;
case MP_TUNNELBRIDGE:
- case MP_STREET:
+ case MP_ROAD:
case MP_STATION:
break;
diff --git a/src/npf.cpp b/src/npf.cpp
index 5f7fce75c..57b5dad04 100644
--- a/src/npf.cpp
+++ b/src/npf.cpp
@@ -232,7 +232,7 @@ static void NPFMarkTile(TileIndex tile)
}
break;
- case MP_STREET:
+ case MP_ROAD:
if (!IsTileDepotType(tile, TRANSPORT_ROAD)) {
SetRoadside(tile, ROADSIDE_BARREN);
MarkTileDirtyByTile(tile);
@@ -276,7 +276,7 @@ static int32 NPFRoadPathCost(AyStar* as, AyStarNode* current, OpenListNode* pare
cost = IsTunnel(tile) ? NPFTunnelCost(current) : NPFBridgeCost(current);
break;
- case MP_STREET:
+ case MP_ROAD:
cost = NPF_TILE_LENGTH;
/* Increase the cost for level crossings */
if (IsLevelCrossing(tile)) cost += _patches.npf_crossing_penalty;
@@ -327,7 +327,7 @@ static int32 NPFRailPathCost(AyStar* as, AyStarNode* current, OpenListNode* pare
cost = _trackdir_length[trackdir]; /* Should be different for diagonal tracks */
break;
- case MP_STREET: /* Railway crossing */
+ case MP_ROAD: /* Railway crossing */
cost = NPF_TILE_LENGTH;
break;
@@ -468,7 +468,7 @@ static bool VehicleMayEnterTile(Owner owner, TileIndex tile, DiagDirection enter
}
switch (GetTileType(tile)) {
- case MP_STREET:
+ case MP_ROAD:
/* rail-road crossing : are we looking at the railway part? */
if (IsLevelCrossing(tile) &&
DiagDirToAxis(enterdir) != GetCrossingRoadAxis(tile)) {
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 53547997c..757a79b45 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -1153,7 +1153,7 @@ static void ConvertTownOwner()
for (tile = 0; tile != MapSize(); tile++) {
switch (GetTileType(tile)) {
- case MP_STREET:
+ case MP_ROAD:
if (GB(_m[tile].m5, 4, 2) == ROAD_TILE_CROSSING && HASBIT(_m[tile].m4, 7)) {
_m[tile].m4 = OWNER_TOWN;
}
@@ -1473,7 +1473,7 @@ bool AfterLoadGame()
SetTownIndex(t, CalcClosestTownFromTile(t, (uint)-1)->index);
break;
- case MP_STREET:
+ case MP_ROAD:
_m[t].m4 |= (_m[t].m2 << 4);
if (IsTileOwner(t, OWNER_TOWN)) {
SetTownIndex(t, CalcClosestTownFromTile(t, (uint)-1)->index);
@@ -1535,7 +1535,7 @@ bool AfterLoadGame()
}
break;
- case MP_STREET:
+ case MP_ROAD:
/* Swap m3 and m4, so the track type for rail crossings is the
* same as for normal rail. */
Swap(_m[t].m3, _m[t].m4);
@@ -1551,7 +1551,7 @@ bool AfterLoadGame()
bool old_bridge = CheckSavegameVersion(42);
for (TileIndex t = 0; t < map_size; t++) {
switch(GetTileType(t)) {
- case MP_STREET:
+ case MP_ROAD:
SB(_m[t].m5, 6, 2, GB(_m[t].m5, 4, 2));
switch (GetRoadTileType(t)) {
default: NOT_REACHED();
@@ -1679,7 +1679,7 @@ bool AfterLoadGame()
SetRailType(t, UpdateRailType(GetRailType(t), min_rail));
break;
- case MP_STREET:
+ case MP_ROAD:
if (IsLevelCrossing(t)) {
SetRailType(t, UpdateRailType(GetRailType(t), min_rail));
}
@@ -1781,7 +1781,7 @@ bool AfterLoadGame()
}
break;
- case MP_STREET: /* Clear PBS reservation on crossing */
+ case MP_ROAD: /* Clear PBS reservation on crossing */
if (IsLevelCrossing(t)) CLRBIT(_m[t].m5, 0);
break;
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 1bebf1bd5..c77fe32f0 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -278,7 +278,7 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile)
}
break;
- case MP_STREET:
+ case MP_ROAD:
if (GetRoadTileType(tile) == ROAD_TILE_DEPOT && v->type == VEH_ROAD && IsTileOwner(tile, _local_player)) {
order.type = OT_GOTO_DEPOT;
order.flags = OF_PART_OF_ORDERS;
diff --git a/src/rail.cpp b/src/rail.cpp
index a5f2633fd..e1fa6792a 100644
--- a/src/rail.cpp
+++ b/src/rail.cpp
@@ -110,7 +110,7 @@ RailType GetTileRailType(TileIndex tile)
case MP_RAILWAY:
return GetRailType(tile);
- case MP_STREET:
+ case MP_ROAD:
/* rail/road crossing */
if (IsLevelCrossing(tile)) return GetRailType(tile);
break;
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index d222c0587..4c6a01563 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -265,7 +265,7 @@ CommandCost CmdBuildSingleRail(TileIndex tile, uint32 flags, uint32 p1, uint32 p
}
break;
- case MP_STREET:
+ case MP_ROAD:
#define M(x) (1 << (x))
/* Level crossings may only be built on these slopes */
if (!HASBIT(M(SLOPE_SEN) | M(SLOPE_ENW) | M(SLOPE_NWS) | M(SLOPE_NS) | M(SLOPE_WSE) | M(SLOPE_EW) | M(SLOPE_FLAT), tileh)) {
@@ -354,7 +354,7 @@ CommandCost CmdRemoveSingleRail(TileIndex tile, uint32 flags, uint32 p1, uint32
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
switch (GetTileType(tile)) {
- case MP_STREET: {
+ case MP_ROAD: {
if (!IsLevelCrossing(tile) ||
GetCrossingRailBits(tile) != trackbit ||
(_current_player != OWNER_WATER && !CheckTileOwnership(tile)) ||
@@ -757,7 +757,7 @@ static bool CheckSignalAutoFill(TileIndex &tile, Trackdir &trackdir, int &signal
}
return true;
- case MP_STREET:
+ case MP_ROAD:
if (!IsLevelCrossing(tile)) return false;
signal_ctr += 2;
return true;
@@ -1076,7 +1076,7 @@ CommandCost CmdConvertRail(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
switch (GetTileType(tile)) {
case MP_RAILWAY: proc = DoConvertRail; break;
case MP_STATION: proc = DoConvertStationRail; break;
- case MP_STREET: proc = DoConvertStreetRail; break;
+ case MP_ROAD: proc = DoConvertStreetRail; break;
case MP_TUNNELBRIDGE: proc = DoConvertTunnelBridgeRail; break;
default: continue;
}
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index f0ff25bf2..b6abc4b35 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -124,7 +124,7 @@ CommandCost CmdRemoveRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
Town *t = NULL;
switch (GetTileType(tile)) {
- case MP_STREET:
+ case MP_ROAD:
if (_game_mode != GM_EDITOR && GetRoadOwner(tile, rt) == OWNER_TOWN) t = GetTownByTile(tile);
break;
@@ -154,7 +154,7 @@ CommandCost CmdRemoveRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
* removal allowance depends on difficulty setting */
if (!CheckforTownRating(flags, t, ROAD_REMOVE)) return CMD_ERROR;
- if (!IsTileType(tile, MP_STREET)) {
+ if (!IsTileType(tile, MP_ROAD)) {
/* If it's the last roadtype, just clear the whole tile */
if (rts == RoadTypeToRoadTypes(rt)) return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
@@ -364,7 +364,7 @@ CommandCost CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
tileh = GetTileSlope(tile, NULL);
switch (GetTileType(tile)) {
- case MP_STREET:
+ case MP_ROAD:
switch (GetRoadTileType(tile)) {
case ROAD_TILE_NORMAL: {
if (HasRoadWorks(tile)) return_cmd_error(STR_ROAD_WORKS_IN_PROGRESS);
@@ -481,7 +481,7 @@ do_clear:;
cost.AddCost(ret);
}
- if (IsTileType(tile, MP_STREET)) {
+ if (IsTileType(tile, MP_ROAD)) {
/* Don't put the pieces that already exist */
pieces &= ComplementRoadBits(existing);
}
@@ -494,7 +494,7 @@ do_clear:;
if (flags & DC_EXEC) {
switch (GetTileType(tile)) {
- case MP_STREET: {
+ case MP_ROAD: {
RoadTileType rtt = GetRoadTileType(tile);
if (existing == ROAD_NONE || rtt == ROAD_TILE_CROSSING) {
SetRoadTypes(tile, GetRoadTypes(tile) | RoadTypeToRoadTypes(rt));
@@ -529,7 +529,7 @@ do_clear:;
break;
}
- if (rt != ROADTYPE_TRAM && IsTileType(tile, MP_STREET) && GetRoadTileType(tile) == ROAD_TILE_NORMAL) {
+ if (rt != ROADTYPE_TRAM && IsTileType(tile, MP_ROAD) && GetRoadTileType(tile) == ROAD_TILE_NORMAL) {
existing |= pieces;
SetDisallowedRoadDirections(tile, (existing == ROAD_X || existing == ROAD_Y) ?
GetDisallowedRoadDirections(tile) ^ toggle_drd : DRD_NONE);
diff --git a/src/road_gui.cpp b/src/road_gui.cpp
index a4681b891..d71cb3fc8 100644
--- a/src/road_gui.cpp
+++ b/src/road_gui.cpp
@@ -122,7 +122,7 @@ static void BuildRoadOutsideStation(TileIndex tile, DiagDirection direction)
{
tile += TileOffsByDiagDir(direction);
// if there is a roadpiece just outside of the station entrance, build a connecting route
- if (IsTileType(tile, MP_STREET) && GetRoadTileType(tile) == ROAD_TILE_NORMAL) {
+ if (IsTileType(tile, MP_ROAD) && GetRoadTileType(tile) == ROAD_TILE_NORMAL) {
if (GetRoadBits(tile, _cur_roadtype) != ROAD_NONE) {
DoCommandP(tile, _cur_roadtype << 4 | DiagDirToRoadBits(ReverseDiagDir(direction)), 0, NULL, CMD_BUILD_ROAD);
}
diff --git a/src/road_map.cpp b/src/road_map.cpp
index c1d8a4337..091e5ca7a 100644
--- a/src/road_map.cpp
+++ b/src/road_map.cpp
@@ -19,7 +19,7 @@ RoadBits GetAnyRoadBits(TileIndex tile, RoadType rt)
if (!HASBIT(GetRoadTypes(tile), rt)) return ROAD_NONE;
switch (GetTileType(tile)) {
- case MP_STREET:
+ case MP_ROAD:
switch (GetRoadTileType(tile)) {
default:
case ROAD_TILE_NORMAL: return GetRoadBits(tile, rt);
@@ -51,7 +51,7 @@ TrackBits GetAnyRoadTrackBits(TileIndex tile, RoadType rt)
uint32 r;
/* Don't allow local authorities to build roads through road depots or road stops. */
- if ((IsTileType(tile, MP_STREET) && IsTileDepotType(tile, TRANSPORT_ROAD)) || (IsTileType(tile, MP_STATION) && !IsDriveThroughStopTile(tile)) || !HASBIT(GetRoadTypes(tile), rt)) {
+ if ((IsTileType(tile, MP_ROAD) && IsTileDepotType(tile, TRANSPORT_ROAD)) || (IsTileType(tile, MP_STATION) && !IsDriveThroughStopTile(tile)) || !HASBIT(GetRoadTypes(tile), rt)) {
return TRACK_BIT_NONE;
}
diff --git a/src/road_map.h b/src/road_map.h
index 8fe860707..fd28b4209 100644
--- a/src/road_map.h
+++ b/src/road_map.h
@@ -19,7 +19,7 @@ enum RoadTileType {
static inline RoadTileType GetRoadTileType(TileIndex t)
{
- assert(IsTileType(t, MP_STREET));
+ assert(IsTileType(t, MP_ROAD));
return (RoadTileType)GB(_m[t].m5, 6, 2);
}
@@ -30,7 +30,7 @@ static inline bool IsLevelCrossing(TileIndex t)
static inline bool IsLevelCrossingTile(TileIndex t)
{
- return IsTileType(t, MP_STREET) && IsLevelCrossing(t);
+ return IsTileType(t, MP_ROAD) && IsLevelCrossing(t);
}
static inline RoadBits GetRoadBits(TileIndex t, RoadType rt)
@@ -62,7 +62,7 @@ static inline void SetRoadBits(TileIndex t, RoadBits r, RoadType rt)
static inline RoadTypes GetRoadTypes(TileIndex t)
{
- if (IsTileType(t, MP_STREET)) {
+ if (IsTileType(t, MP_ROAD)) {
return (RoadTypes)GB(_me[t].m7, 5, 3);
} else {
return (RoadTypes)GB(_m[t].m3, 0, 3);
@@ -71,7 +71,7 @@ static inline RoadTypes GetRoadTypes(TileIndex t)
static inline void SetRoadTypes(TileIndex t, RoadTypes rt)
{
- if (IsTileType(t, MP_STREET)) {
+ if (IsTileType(t, MP_ROAD)) {
SB(_me[t].m7, 5, 3, rt);
} else {
assert(IsTileType(t, MP_STATION) || IsTileType(t, MP_TUNNELBRIDGE));
@@ -81,7 +81,7 @@ static inline void SetRoadTypes(TileIndex t, RoadTypes rt)
static inline Owner GetRoadOwner(TileIndex t, RoadType rt)
{
- if (!IsTileType(t, MP_STREET)) return GetTileOwner(t);
+ if (!IsTileType(t, MP_ROAD)) return GetTileOwner(t);
switch (GetRoadTileType(t)) {
default: NOT_REACHED();
@@ -115,7 +115,7 @@ static inline Owner GetRoadOwner(TileIndex t, RoadType rt)
static inline void SetRoadOwner(TileIndex t, RoadType rt, Owner o)
{
- if (!IsTileType(t, MP_STREET)) return SetTileOwner(t, o);
+ if (!IsTileType(t, MP_ROAD)) return SetTileOwner(t, o);
switch (GetRoadTileType(t)) {
default: NOT_REACHED();
@@ -307,7 +307,7 @@ TrackBits GetAnyRoadTrackBits(TileIndex tile, RoadType rt);
static inline void MakeRoadNormal(TileIndex t, RoadBits bits, RoadTypes rot, TownID town, Owner road, Owner tram, Owner hway)
{
- SetTileType(t, MP_STREET);
+ SetTileType(t, MP_ROAD);
SetTileOwner(t, road);
_m[t].m2 = town;
_m[t].m3 = 0;
@@ -321,7 +321,7 @@ static inline void MakeRoadNormal(TileIndex t, RoadBits bits, RoadTypes rot, Tow
static inline void MakeRoadCrossing(TileIndex t, Owner road, Owner tram, Owner hway, Owner rail, Axis roaddir, RailType rat, RoadTypes rot, uint town)
{
- SetTileType(t, MP_STREET);
+ SetTileType(t, MP_ROAD);
SetTileOwner(t, rail);
_m[t].m2 = town;
_m[t].m3 = rat;
@@ -335,7 +335,7 @@ static inline void MakeRoadCrossing(TileIndex t, Owner road, Owner tram, Owner h
static inline void MakeRoadDepot(TileIndex t, Owner owner, DiagDirection dir, RoadType rt)
{
- SetTileType(t, MP_STREET);
+ SetTileType(t, MP_ROAD);
SetTileOwner(t, owner);
_m[t].m2 = 0;
_m[t].m3 = 0;
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 7ddd8b123..0180b345f 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -395,7 +395,7 @@ static bool EnumRoadSignalFindDepot(TileIndex tile, void* data, Trackdir trackdi
tile += TileOffsByDiagDir(_road_pf_directions[trackdir]);
- if (IsTileType(tile, MP_STREET) &&
+ if (IsTileType(tile, MP_ROAD) &&
GetRoadTileType(tile) == ROAD_TILE_DEPOT &&
IsTileOwner(tile, rfdd->owner) &&
length < rfdd->best_length) {
@@ -543,7 +543,7 @@ CommandCost CmdTurnRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
return CMD_ERROR;
}
- if (IsTileType(v->tile, MP_STREET) && GetRoadTileType(v->tile) == ROAD_TILE_NORMAL && GetDisallowedRoadDirections(v->tile) != DRD_NONE) return CMD_ERROR;
+ if (IsTileType(v->tile, MP_ROAD) && GetRoadTileType(v->tile) == ROAD_TILE_NORMAL && GetDisallowedRoadDirections(v->tile) != DRD_NONE) return CMD_ERROR;
if (IsTunnelTile(v->tile) && DirToDiagDir(v->direction) == GetTunnelDirection(v->tile)) return CMD_ERROR;
if (IsBridgeTile(v->tile) && DirToDiagDir(v->direction) == GetBridgeRampDirection(v->tile)) return CMD_ERROR;
@@ -1145,7 +1145,7 @@ static Trackdir RoadFindPathToDest(Vehicle* v, TileIndex tile, DiagDirection ent
TrackdirBits signal = (TrackdirBits)GB(r, 16, 16);
TrackdirBits trackdirs = (TrackdirBits)GB(r, 0, 16);
- if (IsTileType(tile, MP_STREET)) {
+ if (IsTileType(tile, MP_ROAD)) {
if (GetRoadTileType(tile) == ROAD_TILE_DEPOT && (!IsTileOwner(tile, v->owner) || GetRoadDepotDirection(tile) == enterdir || (GetRoadTypes(tile) & v->u.road.compatible_roadtypes) == 0)) {
/* Road depot owned by another player or with the wrong orientation */
trackdirs = TRACKDIR_BIT_NONE;
@@ -1232,7 +1232,7 @@ static Trackdir RoadFindPathToDest(Vehicle* v, TileIndex tile, DiagDirection ent
} else {
DiagDirection dir;
- if (IsTileType(desttile, MP_STREET)) {
+ if (IsTileType(desttile, MP_ROAD)) {
if (GetRoadTileType(desttile) == ROAD_TILE_DEPOT) {
dir = GetRoadDepotDirection(desttile);
goto do_it;
@@ -1394,7 +1394,7 @@ static Trackdir FollowPreviousRoadVehicle(const Vehicle *v, const Vehicle *prev,
diag_dir = GetTunnelDirection(tile);
} else if (IsBridgeTile(tile)) {
diag_dir = GetBridgeRampDirection(tile);
- } else if (IsTileType(tile, MP_STREET) && GetRoadTileType(tile) == ROAD_TILE_DEPOT) {
+ } else if (IsTileType(tile, MP_ROAD) && GetRoadTileType(tile) == ROAD_TILE_DEPOT) {
diag_dir = ReverseDiagDir(GetRoadDepotDirection(tile));
}
@@ -1512,12 +1512,12 @@ again:
case TRACKDIR_RVREV_SW: needed = ROAD_NE; break;
case TRACKDIR_RVREV_NW: needed = ROAD_SE; break;
}
- if (!IsTileType(tile, MP_STREET) || GetRoadTileType(tile) != ROAD_TILE_NORMAL || HasRoadWorks(tile) || (needed & GetRoadBits(tile, ROADTYPE_TRAM)) == ROAD_NONE) {
+ if (!IsTileType(tile, MP_ROAD) || GetRoadTileType(tile) != ROAD_TILE_NORMAL || HasRoadWorks(tile) || (needed & GetRoadBits(tile, ROADTYPE_TRAM)) == ROAD_NONE) {
/* The tram cannot turn here */
v->cur_speed = 0;
return false;
}
- } else if (IsTileType(v->tile, MP_STREET) && GetRoadTileType(v->tile) == ROAD_TILE_NORMAL && GetDisallowedRoadDirections(v->tile) != DRD_NONE) {
+ } else if (IsTileType(v->tile, MP_ROAD) && GetRoadTileType(v->tile) == ROAD_TILE_NORMAL && GetDisallowedRoadDirections(v->tile) != DRD_NONE) {
v->cur_speed = 0;
return false;
} else {
@@ -1625,7 +1625,7 @@ again:
* it's on a depot tile, check if it's time to activate the next vehicle in
* the chain yet. */
if (v->next != NULL &&
- IsTileType(v->tile, MP_STREET) && GetRoadTileType(v->tile) == ROAD_TILE_DEPOT) {
+ IsTileType(v->tile, MP_ROAD) && GetRoadTileType(v->tile) == ROAD_TILE_DEPOT) {
if (v->u.road.frame == v->u.road.cached_veh_length + RVC_DEPOT_START_FRAME) {
RoadVehLeaveDepot(v->next, false);
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index 5c32b8810..26c18ee5c 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -318,7 +318,7 @@ static inline TileType GetEffectiveTileType(TileIndex tile)
}
switch (tt) {
case TRANSPORT_RAIL: t = MP_RAILWAY; break;
- case TRANSPORT_ROAD: t = MP_STREET; break;
+ case TRANSPORT_ROAD: t = MP_ROAD; break;
default: t = MP_WATER; break;
}
}
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index ea8698647..160435772 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1312,7 +1312,7 @@ CommandCost CmdBuildRoadStop(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
bool type = HASBIT(p2, 0);
bool is_drive_through = HASBIT(p2, 1);
- bool build_over_road = is_drive_through && IsTileType(tile, MP_STREET) && GetRoadTileType(tile) == ROAD_TILE_NORMAL;
+ bool build_over_road = is_drive_through && IsTileType(tile, MP_ROAD) && GetRoadTileType(tile) == ROAD_TILE_NORMAL;
bool town_owned_road = build_over_road && IsTileOwner(tile, OWNER_TOWN);
RoadTypes rts = (RoadTypes)GB(p2, 2, 3);
diff --git a/src/tile.h b/src/tile.h
index 156f75b76..c4ce7454b 100644
--- a/src/tile.h
+++ b/src/tile.h
@@ -26,7 +26,7 @@
enum TileType {
MP_CLEAR, ///< A tile without any structures, i.e. grass, rocks, farm fields etc.
MP_RAILWAY, ///< A railway
- MP_STREET, ///< A street
+ MP_ROAD, ///< A tile with road (or tram tracks)
MP_HOUSE, ///< A house by a town
MP_TREES, ///< Tile got trees
MP_STATION, ///< A tile of a station
@@ -46,7 +46,7 @@ enum TileType {
enum TropicZone {
TROPICZONE_INVALID = 0, ///< Invalid tropiczone-type
TROPICZONE_DESERT = 1, ///< Tile is desert
- TROPICZONE_RAINFOREST = 2, ///< Normal grass tile
+ TROPICZONE_RAINFOREST = 2, ///< Rainforest tile
};
Slope GetTileSlope(TileIndex tile, uint *h);
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 6615c1b36..956e8bfca 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -82,7 +82,7 @@ void DestroyTown(Town *t)
if (GetTownByTile(tile) == t) DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
break;
- case MP_STREET:
+ case MP_ROAD:
case MP_TUNNELBRIDGE:
if (IsTileOwner(tile, OWNER_TOWN) &&
ClosestTownFromTile(tile, (uint)-1) == t)
@@ -1151,7 +1151,7 @@ static int GrowTownAtRoad(Town *t, TileIndex tile)
do block = Random() & 3; while (!HASBIT(mask, block));
tile += ToTileIndexDiff(_roadblock_tileadd[block]);
- if (IsTileType(tile, MP_STREET)) {
+ if (IsTileType(tile, MP_ROAD)) {
/* Don't allow building over roads of other cities */
if (IsTileOwner(tile, OWNER_TOWN) && GetTownByTile(tile) != t) {
_grow_town_result = -1;
@@ -2233,7 +2233,7 @@ Town* CalcClosestTownFromTile(TileIndex tile, uint threshold)
Town *ClosestTownFromTile(TileIndex tile, uint threshold)
{
if (IsTileType(tile, MP_HOUSE) || (
- IsTileType(tile, MP_STREET) &&
+ IsTileType(tile, MP_ROAD) &&
GetRoadOwner(tile, ROADTYPE_ROAD) == OWNER_TOWN
)) {
return GetTownByTile(tile);
diff --git a/src/town_map.h b/src/town_map.h
index d1fcf4b7b..661f39abc 100644
--- a/src/town_map.h
+++ b/src/town_map.h
@@ -11,25 +11,25 @@
/**
* Get the index of which town this house/street is attached to.
* @param t the tile
- * @pre IsTileType(t, MP_HOUSE) or IsTileType(t, MP_STREET)
+ * @pre IsTileType(t, MP_HOUSE) or IsTileType(t, MP_ROAD)
* @return TownID
*/
static inline TownID GetTownIndex(TileIndex t)
{
- assert(IsTileType(t, MP_HOUSE) || IsTileType(t, MP_STREET)); // XXX incomplete
+ assert(IsTileType(t, MP_HOUSE) || IsTileType(t, MP_ROAD)); // XXX incomplete
return _m[t].m2;
}
/**
* Set the town index for a road or house tile.
* @param t the tile
- * @pre IsTileType(t, MP_HOUSE) or IsTileType(t, MP_STREET)
+ * @pre IsTileType(t, MP_HOUSE) or IsTileType(t, MP_ROAD)
* @param index the index of the town
- * @pre IsTileType(t, MP_STREET) || IsTileType(t, MP_HOUSE)
+ * @pre IsTileType(t, MP_ROAD) || IsTileType(t, MP_HOUSE)
*/
static inline void SetTownIndex(TileIndex t, TownID index)
{
- assert(IsTileType(t, MP_HOUSE) || IsTileType(t, MP_STREET));
+ assert(IsTileType(t, MP_HOUSE) || IsTileType(t, MP_ROAD));
_m[t].m2 = index;
}
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index 2aab042a3..b2e3245f8 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -389,7 +389,7 @@ CommandCost CmdBuildBridge(TileIndex end_tile, uint32 flags, uint32 p1, uint32 p
if (!IsPlainRailTile(tile)) goto not_valid_below;
break;
- case MP_STREET:
+ case MP_ROAD:
if (GetRoadTileType(tile) == ROAD_TILE_DEPOT) goto not_valid_below;
break;
diff --git a/src/yapf/yapf_costrail.hpp b/src/yapf/yapf_costrail.hpp
index 8ecd4e94a..3b57fe328 100644
--- a/src/yapf/yapf_costrail.hpp
+++ b/src/yapf/yapf_costrail.hpp
@@ -112,7 +112,7 @@ public:
if (IsDiagonalTrackdir(trackdir)) {
cost += YAPF_TILE_LENGTH;
switch (GetTileType(tile)) {
- case MP_STREET:
+ case MP_ROAD:
/* Increase the cost for level crossings */
if (IsLevelCrossing(tile))
cost += Yapf().PfGetSettings().rail_crossing_penalty;
diff --git a/src/yapf/yapf_road.cpp b/src/yapf/yapf_road.cpp
index d048bbbe9..99bde7fdb 100644
--- a/src/yapf/yapf_road.cpp
+++ b/src/yapf/yapf_road.cpp
@@ -48,7 +48,7 @@ protected:
if (IsDiagonalTrackdir(trackdir)) {
cost += YAPF_TILE_LENGTH;
switch (GetTileType(tile)) {
- case MP_STREET:
+ case MP_ROAD:
/* Increase the cost for level crossings */
if (IsLevelCrossing(tile))
cost += Yapf().PfGetSettings().road_crossing_penalty;
@@ -442,7 +442,7 @@ Depot* YapfFindNearestRoadDepot(const Vehicle *v)
return NULL;
// handle the case when our vehicle is already in the depot tile
- if (IsTileType(tile, MP_STREET) && IsTileDepotType(tile, TRANSPORT_ROAD)) {
+ if (IsTileType(tile, MP_ROAD) && IsTileDepotType(tile, TRANSPORT_ROAD)) {
// only what we need to return is the Depot*
return GetDepotByTile(tile);
}