summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-07-29 23:42:59 +0000
committerrubidium <rubidium@openttd.org>2007-07-29 23:42:59 +0000
commit7fb3f54584fd9dd3266997cd12bd1853c18ad5bb (patch)
tree35f2cfc46313d08457c127c393370517d519fab3 /src/ai
parentd4666b51eebaf8431a0f60e342182c57215db2ef (diff)
downloadopenttd-7fb3f54584fd9dd3266997cd12bd1853c18ad5bb.tar.xz
(svn r10733) -Codechange: change MP_STREET into MP_ROAD as we use the word "road" everywhere except in the tile type.
Diffstat (limited to 'src/ai')
-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
4 files changed, 13 insertions, 13 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;