|
@@ -284,13 +284,13 @@ public:
|
|
|
|
|
|
// find the best path
|
|
|
Yapf().FindPath(v);
|
|
|
|
|
|
// if path not found - return INVALID_TRACKDIR
|
|
|
Trackdir next_trackdir = INVALID_TRACKDIR;
|
|
|
Node* pNode = &Yapf().GetBestNode();
|
|
|
Node *pNode = Yapf().GetBestNode();
|
|
|
if (pNode != NULL) {
|
|
|
// path was found or at least suggested
|
|
|
// walk through the path back to its origin
|
|
|
while (pNode->m_parent != NULL) {
|
|
|
pNode = pNode->m_parent;
|
|
|
}
|
|
@@ -326,13 +326,13 @@ public:
|
|
|
|
|
|
// find the best path
|
|
|
Yapf().FindPath(v);
|
|
|
|
|
|
// if path not found - return distance = UINT_MAX
|
|
|
uint dist = UINT_MAX;
|
|
|
Node* pNode = &Yapf().GetBestNode();
|
|
|
Node *pNode = Yapf().GetBestNode();
|
|
|
if (pNode != NULL) {
|
|
|
// path was found or at least suggested
|
|
|
// get the path cost estimate
|
|
|
dist = pNode->GetCostEstimate();
|
|
|
}
|
|
|
|
|
@@ -368,14 +368,14 @@ public:
|
|
|
// find the best path
|
|
|
bool bFound = Yapf().FindPath(v);
|
|
|
if (!bFound) return false;
|
|
|
|
|
|
// some path found
|
|
|
// get found depot tile
|
|
|
Node& n = Yapf().GetBestNode();
|
|
|
TileIndex depot_tile = n.m_segment_last_tile;
|
|
|
Node *n = Yapf().GetBestNode();
|
|
|
TileIndex depot_tile = n->m_segment_last_tile;
|
|
|
assert(IsTileDepotType(depot_tile, TRANSPORT_ROAD));
|
|
|
Depot* ret = GetDepotByTile(depot_tile);
|
|
|
return ret;
|
|
|
}
|
|
|
};
|
|
|
|