From e56fee612c96529302ab31d038449a828a6db043 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 24 Jan 2022 00:39:24 +0000 Subject: [PATCH] Zoning: Fix unserved industries mode with partially overlapping catchment --- src/zoning_cmd.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/zoning_cmd.cpp b/src/zoning_cmd.cpp index a6f7429751..895956b7ce 100644 --- a/src/zoning_cmd.cpp +++ b/src/zoning_cmd.cpp @@ -227,9 +227,10 @@ SpriteID TileZoneCheckUnservedBuildingsEvaluation(TileIndex tile, Owner owner) SpriteID TileZoneCheckUnservedIndustriesEvaluation(TileIndex tile, Owner owner) { if (IsTileType(tile, MP_INDUSTRY)) { - StationFinder stations(TileArea(tile, 1, 1)); + const Industry *ind = Industry::GetByTile(tile); + if (ind->neutral_station != nullptr) return ZONING_INVALID_SPRITE_ID; - for (const Station *st : *stations.GetStations()) { + for (const Station *st : ind->stations_near) { if (st->owner == owner && st->facilities & (~FACIL_BUS_STOP)) { return ZONING_INVALID_SPRITE_ID; }