diff options
author | rubidium <rubidium@openttd.org> | 2010-01-04 18:30:10 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-01-04 18:30:10 +0000 |
commit | 3e131e2fece740591d9187e19789a34b36c763fa (patch) | |
tree | eff6d495176fe6d806e6990f5faa5c7ecb5a05e1 /src/ai | |
parent | 87466a4ed091035b758ef981e6600e2b03cbfe30 (diff) | |
download | openttd-3e131e2fece740591d9187e19789a34b36c763fa.tar.xz |
(svn r18718) -Codechange: make a wrapper macro for looping TileAreas
Diffstat (limited to 'src/ai')
-rw-r--r-- | src/ai/api/ai_industry.cpp | 4 | ||||
-rw-r--r-- | src/ai/api/ai_tilelist.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/ai/api/ai_industry.cpp b/src/ai/api/ai_industry.cpp index cf715d34e..6fb208ce9 100644 --- a/src/ai/api/ai_industry.cpp +++ b/src/ai/api/ai_industry.cpp @@ -162,7 +162,7 @@ if (!HasHeliport(industry_id)) return INVALID_TILE; const Industry *ind = ::Industry::Get(industry_id); - TILE_LOOP(tile_cur, ind->location.w, ind->location.h, ind->location.tile) { + TILE_AREA_LOOP(tile_cur, ind->location) { if (IsTileType(tile_cur, MP_STATION) && IsOilRig(tile_cur)) { return tile_cur; } @@ -184,7 +184,7 @@ if (!HasDock(industry_id)) return INVALID_TILE; const Industry *ind = ::Industry::Get(industry_id); - TILE_LOOP(tile_cur, ind->location.w, ind->location.h, ind->location.tile) { + TILE_AREA_LOOP(tile_cur, ind->location) { if (IsTileType(tile_cur, MP_STATION) && IsOilRig(tile_cur)) { return tile_cur; } diff --git a/src/ai/api/ai_tilelist.cpp b/src/ai/api/ai_tilelist.cpp index 2cf5ca661..d32b22270 100644 --- a/src/ai/api/ai_tilelist.cpp +++ b/src/ai/api/ai_tilelist.cpp @@ -86,7 +86,7 @@ AITileList_IndustryAccepting::AITileList_IndustryAccepting(IndustryID industry_i if (!_settings_game.station.modified_catchment) radius = CA_UNMODIFIED; - TILE_LOOP(cur_tile, i->location.w + radius * 2, i->location.h+ radius * 2, i->location.tile - ::TileDiffXY(radius, radius)) { + TILE_LOOP(cur_tile, i->location.w + radius * 2, i->location.h + radius * 2, i->location.tile - ::TileDiffXY(radius, radius)) { if (!::IsValidTile(cur_tile)) continue; /* Exclude all tiles that belong to this industry */ if (::IsTileType(cur_tile, MP_INDUSTRY) && ::GetIndustryIndex(cur_tile) == industry_id) continue; @@ -123,7 +123,7 @@ AITileList_IndustryProducing::AITileList_IndustryProducing(IndustryID industry_i if (!_settings_game.station.modified_catchment) radius = CA_UNMODIFIED; - TILE_LOOP(cur_tile, i->location.w + radius * 2, i->location.h+ radius * 2, i->location.tile - ::TileDiffXY(radius, radius)) { + TILE_LOOP(cur_tile, i->location.w + radius * 2, i->location.h + radius * 2, i->location.tile - ::TileDiffXY(radius, radius)) { if (!::IsValidTile(cur_tile)) continue; /* Exclude all tiles that belong to this industry */ if (::IsTileType(cur_tile, MP_INDUSTRY) && ::GetIndustryIndex(cur_tile) == industry_id) continue; |