summaryrefslogtreecommitdiff
path: root/src/subsidy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/subsidy.cpp')
-rw-r--r--src/subsidy.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/subsidy.cpp b/src/subsidy.cpp
index 1b375d215..eac81e362 100644
--- a/src/subsidy.cpp
+++ b/src/subsidy.cpp
@@ -573,15 +573,11 @@ bool CheckSubsidised(CargoID cargo_type, CompanyID company, SourceType src_type,
if (s->cargo_type != cargo_type || s->src_type != src_type || s->src != src) continue;
if (s->IsAwarded() && s->awarded != company) continue;
- Rect rect = st->GetCatchmentRect();
-
- for (int y = rect.top; y <= rect.bottom; y++) {
- for (int x = rect.left; x <= rect.right; x++) {
- TileIndex tile = TileXY(x, y);
- if (!IsTileType(tile, MP_HOUSE)) continue;
- const Town *t = Town::GetByTile(tile);
- if (t->cache.part_of_subsidy & POS_DST) towns_near.Include(t);
- }
+ BitmapTileIterator it(st->catchment_tiles);
+ for (TileIndex tile = it; tile != INVALID_TILE; tile = ++it) {
+ if (!IsTileType(tile, MP_HOUSE)) continue;
+ const Town *t = Town::GetByTile(tile);
+ if (t->cache.part_of_subsidy & POS_DST) towns_near.Include(t);
}
break;
}