summaryrefslogtreecommitdiff
path: root/src/station.cpp
diff options
context:
space:
mode:
authorPeterN <peter@fuzzle.org>2019-04-16 20:30:07 +0100
committerGitHub <noreply@github.com>2019-04-16 20:30:07 +0100
commit671a310d219cb0e12270578d0e63cd66701eae02 (patch)
treed237419733b3614610cb7f4b3ddf15d93a3e7f44 /src/station.cpp
parent8ae15d9797194c3b30ab562ae6688d73a5a95159 (diff)
downloadopenttd-671a310d219cb0e12270578d0e63cd66701eae02.tar.xz
Fix #7235: Ensure catchment area of neutral station covers entire industry. (#7518)
Diffstat (limited to 'src/station.cpp')
-rw-r--r--src/station.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/station.cpp b/src/station.cpp
index 85603a38c..e8ae1bc20 100644
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -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) {