Improve pathfinder support for multiple docks

The pathfinder can now find docks other than the Manhattan closest one.

Based on Cirdan commits:
afc7969c13d7ca59afe4dae4bf88122ba8d27df2
4067190dedcd3e5f668ea4f49b1dd8dfed10b2a7
d9be6b712d2ae4fb1b5ae844dde4919dd24c4fb2
This commit is contained in:
Jonathan G Rennison
2018-02-05 18:21:05 +00:00
parent ed04845514
commit 955126efac
8 changed files with 137 additions and 150 deletions

View File

@@ -313,6 +313,14 @@ Rect Station::GetCatchmentRectUsingRadius(uint catchment_radius) const
return ret;
}
bool Station::IsDockingTile(TileIndex tile) const
{
for (const Dock *d = this->docks; d != NULL; d = d->next) {
if (tile == d->GetDockingTile()) return true;
}
return false;
}
/** Rect and pointer to IndustryVector */
struct RectAndIndustryVector {
Rect rect; ///< The rectangle to search the industries in.