Fix #7235: Ensure catchment area of neutral station covers entire industry. (#7518)

This commit is contained in:
PeterN
2019-04-16 20:30:07 +01:00
committed by GitHub
parent 8ae15d9797
commit 671a310d21
2 changed files with 13 additions and 2 deletions

View File

@@ -421,10 +421,10 @@ void Station::RecomputeCatchment()
this->catchment_tiles.Reset();
return;
}
this->catchment_tiles.Initialize(GetCatchmentRect());
if (!_settings_game.station.serve_neutral_industries && this->industry != nullptr) {
/* Station is associated with an industry, so we only need to deliver to that industry. */
this->catchment_tiles.Initialize(this->industry->location);
TILE_AREA_LOOP(tile, this->industry->location) {
if (IsTileType(tile, MP_INDUSTRY) && GetIndustryIndex(tile) == this->industry->index) {
this->catchment_tiles.SetTile(tile);
@@ -440,6 +440,8 @@ void Station::RecomputeCatchment()
return;
}
this->catchment_tiles.Initialize(GetCatchmentRect());
/* 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) {