mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Remove some unnecessary local variables.
parent
c39554a210
commit
e50c1774fc
|
@ -58,8 +58,7 @@ public:
|
||||||
/** Called by YAPF to detect if node ends in the desired destination */
|
/** Called by YAPF to detect if node ends in the desired destination */
|
||||||
inline bool PfDetectDestination(TileIndex tile, Trackdir)
|
inline bool PfDetectDestination(TileIndex tile, Trackdir)
|
||||||
{
|
{
|
||||||
bool bDest = IsRailDepotTile(tile);
|
return IsRailDepotTile(tile);
|
||||||
return bDest;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -353,8 +353,7 @@ public:
|
||||||
Yapf().SetOrigin(t1, td);
|
Yapf().SetOrigin(t1, td);
|
||||||
Yapf().SetDestination(v, override_railtype);
|
Yapf().SetDestination(v, override_railtype);
|
||||||
|
|
||||||
bool bFound = Yapf().FindPath(v);
|
if (!Yapf().FindPath(v)) return false;
|
||||||
if (!bFound) return false;
|
|
||||||
|
|
||||||
/* Found a destination, set as reservation target. */
|
/* Found a destination, set as reservation target. */
|
||||||
Node *pNode = Yapf().GetBestNode();
|
Node *pNode = Yapf().GetBestNode();
|
||||||
|
@ -506,9 +505,7 @@ public:
|
||||||
Yapf().SetDestination(v);
|
Yapf().SetDestination(v);
|
||||||
|
|
||||||
/* find the best path */
|
/* find the best path */
|
||||||
bool bFound = Yapf().FindPath(v);
|
if (!Yapf().FindPath(v)) return false;
|
||||||
|
|
||||||
if (!bFound) return false;
|
|
||||||
|
|
||||||
/* path was found
|
/* path was found
|
||||||
* walk through the path back to the origin */
|
* walk through the path back to the origin */
|
||||||
|
@ -518,8 +515,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if it was reversed origin */
|
/* check if it was reversed origin */
|
||||||
Node &best_org_node = *pNode;
|
bool reversed = (pNode->cost != 0);
|
||||||
bool reversed = (best_org_node.cost != 0);
|
|
||||||
return reversed;
|
return reversed;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue