summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ai/api/ai_industry.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/ai/api/ai_industry.cpp b/src/ai/api/ai_industry.cpp
index 10178ed7e..0cb5989aa 100644
--- a/src/ai/api/ai_industry.cpp
+++ b/src/ai/api/ai_industry.cpp
@@ -8,7 +8,9 @@
#include "../../openttd.h"
#include "../../tile_type.h"
#include "../../industry.h"
+#include "../../tile_map.h"
#include "../../strings_func.h"
+#include "../../station_map.h"
#include "../../station_func.h"
#include "table/strings.h"
@@ -161,7 +163,14 @@
if (!IsValidIndustry(industry_id)) return INVALID_TILE;
if (!HasHeliportAndDock(industry_id)) return INVALID_TILE;
- return ::GetIndustry(industry_id)->xy;
+ const Industry *ind = ::GetIndustry(industry_id);
+ BEGIN_TILE_LOOP(tile_cur, ind->width, ind->height, ind->xy);
+ if (IsTileType(tile_cur, MP_STATION) && IsOilRig(tile_cur)) {
+ return tile_cur;
+ }
+ END_TILE_LOOP(tile_cur, ind->width, ind->height, ind->xy);
+
+ return INVALID_TILE;
}
/* static */ IndustryType AIIndustry::GetIndustryType(IndustryID industry_id)