summaryrefslogtreecommitdiff
path: root/src/yapf
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-04-17 18:24:45 +0000
committersmatz <smatz@openttd.org>2008-04-17 18:24:45 +0000
commit059e94e355c9172a42b70ff20b4b8a87dd4889ae (patch)
tree1d21e0ab2e3402600dc144e6cfc0d1e0b5725da1 /src/yapf
parente098b50379219aeb0b8d22d652a3de514759eb3d (diff)
downloadopenttd-059e94e355c9172a42b70ff20b4b8a87dd4889ae.tar.xz
(svn r12753) -Codechange: do not use IsDepotTypeTile() where simpler function can be used
Diffstat (limited to 'src/yapf')
-rw-r--r--src/yapf/yapf_destrail.hpp2
-rw-r--r--src/yapf/yapf_road.cpp8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/yapf/yapf_destrail.hpp b/src/yapf/yapf_destrail.hpp
index b666999c3..fab8400d1 100644
--- a/src/yapf/yapf_destrail.hpp
+++ b/src/yapf/yapf_destrail.hpp
@@ -43,7 +43,7 @@ public:
/// Called by YAPF to detect if node ends in the desired destination
FORCEINLINE bool PfDetectDestination(TileIndex tile, Trackdir td)
{
- bool bDest = IsDepotTypeTile(tile, TRANSPORT_RAIL);
+ bool bDest = IsRailDepotTile(tile);
return bDest;
}
diff --git a/src/yapf/yapf_road.cpp b/src/yapf/yapf_road.cpp
index 81a6eeb73..853b68e5b 100644
--- a/src/yapf/yapf_road.cpp
+++ b/src/yapf/yapf_road.cpp
@@ -87,7 +87,7 @@ public:
if (v->current_order.IsType(OT_GOTO_STATION) && tile == v->dest_tile) break;
// stop if we have just entered the depot
- if (IsDepotTypeTile(tile, TRANSPORT_ROAD) && trackdir == DiagdirToDiagTrackdir(ReverseDiagDir(GetRoadDepotDirection(tile)))) {
+ if (IsRoadDepotTile(tile) && trackdir == DiagdirToDiagTrackdir(ReverseDiagDir(GetRoadDepotDirection(tile)))) {
// next time we will reverse and leave the depot
break;
}
@@ -148,7 +148,7 @@ public:
/// Called by YAPF to detect if node ends in the desired destination
FORCEINLINE bool PfDetectDestination(Node& n)
{
- bool bDest = IsDepotTypeTile(n.m_segment_last_tile, TRANSPORT_ROAD);
+ bool bDest = IsRoadDepotTile(n.m_segment_last_tile);
return bDest;
}
@@ -370,7 +370,7 @@ public:
// get found depot tile
Node *n = Yapf().GetBestNode();
TileIndex depot_tile = n->m_segment_last_tile;
- assert(IsDepotTypeTile(depot_tile, TRANSPORT_ROAD));
+ assert(IsRoadDepotTile(depot_tile));
Depot* ret = GetDepotByTile(depot_tile);
return ret;
}
@@ -439,7 +439,7 @@ Depot* YapfFindNearestRoadDepot(const Vehicle *v)
return NULL;
// handle the case when our vehicle is already in the depot tile
- if (IsTileType(tile, MP_ROAD) && IsDepotTypeTile(tile, TRANSPORT_ROAD)) {
+ if (IsRoadDepotTile(tile)) {
// only what we need to return is the Depot*
return GetDepotByTile(tile);
}