summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-12-12 17:36:34 +0000
committerrubidium <rubidium@openttd.org>2010-12-12 17:36:34 +0000
commit15b4941401f71657d08d0beb16bbeee864261916 (patch)
tree289284ccda088c7fae51127aa974758e7e9b3a7e /src
parent67e6ad2a4b9f40c4e86fa57c12d74d417931c78a (diff)
downloadopenttd-15b4941401f71657d08d0beb16bbeee864261916.tar.xz
(svn r21483) -Codechange: make StationRect::ScanForStationTiles make use of TILE_AREA_LOOP. Making use of make makes me making use of my brain to determine whether I make use of tautology, or make use of pleonasm, or make use of both, or even make use of neither
Diffstat (limited to 'src')
-rw-r--r--src/station.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/station.cpp b/src/station.cpp
index 6ad19475f..003798a8f 100644
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -428,11 +428,8 @@ CommandCost StationRect::BeforeAddRect(TileIndex tile, int w, int h, StationRect
*/
/* static */ bool StationRect::ScanForStationTiles(StationID st_id, int left_a, int top_a, int right_a, int bottom_a)
{
- TileIndex top_left = TileXY(left_a, top_a);
- int width = right_a - left_a + 1;
- int height = bottom_a - top_a + 1;
-
- TILE_LOOP(tile, width, height, top_left) {
+ TileArea ta(TileXY(left_a, top_a), TileXY(right_a, bottom_a));
+ TILE_AREA_LOOP(tile, ta) {
if (IsTileType(tile, MP_STATION) && GetStationIndex(tile) == st_id) return true;
}