|
@@ -440,25 +440,25 @@ void Station::RecomputeCatchment()
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
/* Loop finding all station tiles */
|
|
|
TileArea ta(TileXY(this->rect.left, this->rect.top), TileXY(this->rect.right, this->rect.bottom));
|
|
|
TILE_AREA_LOOP(tile, ta) {
|
|
|
if (!IsTileType(tile, MP_STATION) || GetStationIndex(tile) != this->index) continue;
|
|
|
|
|
|
uint r = GetTileCatchmentRadius(tile, this);
|
|
|
if (r == CA_NONE) continue;
|
|
|
|
|
|
/* This tile sub-loop doesn't need to test any tiles, they are simply added to the catchment set. */
|
|
|
TileArea ta2(TileXY(max<int>(TileX(tile) - r, 0), max<int>(TileY(tile) - r, 0)), TileXY(min<int>(TileX(tile) + r, MapMaxX()), min<int>(TileY(tile) + r, MapMaxY())));
|
|
|
TileArea ta2 = TileArea(tile, 1, 1).Expand(r);
|
|
|
TILE_AREA_LOOP(tile2, ta2) this->catchment_tiles.SetTile(tile2);
|
|
|
}
|
|
|
|
|
|
/* Search catchment tiles for towns and industries */
|
|
|
BitmapTileIterator it(this->catchment_tiles);
|
|
|
for (TileIndex tile = it; tile != INVALID_TILE; tile = ++it) {
|
|
|
if (IsTileType(tile, MP_HOUSE)) {
|
|
|
Town *t = Town::GetByTile(tile);
|
|
|
t->stations_near.insert(this);
|
|
|
}
|
|
|
if (IsTileType(tile, MP_INDUSTRY)) {
|
|
|
Industry *i = Industry::GetByTile(tile);
|