From abe8cf4985da211ad70c6232a3c737f15574f5de Mon Sep 17 00:00:00 2001 From: PeterN Date: Sat, 13 Apr 2019 14:12:34 +0100 Subject: Codechange: Replace duplicated code with TileArea::Expand() (#7467) --- src/script/api/script_tilelist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/script/api') diff --git a/src/script/api/script_tilelist.cpp b/src/script/api/script_tilelist.cpp index 933a92c4c..adddb989c 100644 --- a/src/script/api/script_tilelist.cpp +++ b/src/script/api/script_tilelist.cpp @@ -66,7 +66,7 @@ ScriptTileList_IndustryAccepting::ScriptTileList_IndustryAccepting(IndustryID in if (!_settings_game.station.modified_catchment) radius = CA_UNMODIFIED; - TileArea ta(i->location.tile - ::TileDiffXY(radius, radius), i->location.w + radius * 2, i->location.h + radius * 2); + TileArea ta = TileArea(i->location).Expand(radius); TILE_AREA_LOOP(cur_tile, ta) { if (!::IsValidTile(cur_tile)) continue; /* Exclude all tiles that belong to this industry */ @@ -102,7 +102,7 @@ ScriptTileList_IndustryProducing::ScriptTileList_IndustryProducing(IndustryID in if (!_settings_game.station.modified_catchment) radius = CA_UNMODIFIED; - TileArea ta(i->location.tile - ::TileDiffXY(radius, radius), i->location.w + radius * 2, i->location.h + radius * 2); + TileArea ta = TileArea(i->location).Expand(radius); TILE_AREA_LOOP(cur_tile, ta) { if (!::IsValidTile(cur_tile)) continue; /* Exclude all tiles that belong to this industry */ -- cgit v1.2.3-70-g09d2