summaryrefslogtreecommitdiff
path: root/src/script/api
diff options
context:
space:
mode:
authorPeterN <peter@fuzzle.org>2019-04-13 14:12:34 +0100
committerGitHub <noreply@github.com>2019-04-13 14:12:34 +0100
commitabe8cf4985da211ad70c6232a3c737f15574f5de (patch)
treeb391f3da8a64d9534f56f22d492bb6095b113343 /src/script/api
parent801cbea9cce1e04e6921bb087add8206cffe1fe1 (diff)
downloadopenttd-abe8cf4985da211ad70c6232a3c737f15574f5de.tar.xz
Codechange: Replace duplicated code with TileArea::Expand() (#7467)
Diffstat (limited to 'src/script/api')
-rw-r--r--src/script/api/script_tilelist.cpp4
1 files changed, 2 insertions, 2 deletions
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 */