|
@@ -139,17 +139,17 @@
|
|
|
/* static */ TileIndex AIIndustry::GetHeliportLocation(IndustryID industry_id)
|
|
|
{
|
|
|
if (!IsValidIndustry(industry_id)) return INVALID_TILE;
|
|
|
if (!HasHeliport(industry_id)) return INVALID_TILE;
|
|
|
|
|
|
const Industry *ind = ::Industry::Get(industry_id);
|
|
|
BEGIN_TILE_LOOP(tile_cur, ind->width, ind->height, ind->xy);
|
|
|
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 */ bool AIIndustry::HasDock(IndustryID industry_id)
|
|
|
{
|
|
@@ -161,17 +161,17 @@
|
|
|
/* static */ TileIndex AIIndustry::GetDockLocation(IndustryID industry_id)
|
|
|
{
|
|
|
if (!IsValidIndustry(industry_id)) return INVALID_TILE;
|
|
|
if (!HasDock(industry_id)) return INVALID_TILE;
|
|
|
|
|
|
const Industry *ind = ::Industry::Get(industry_id);
|
|
|
BEGIN_TILE_LOOP(tile_cur, ind->width, ind->height, ind->xy);
|
|
|
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)
|
|
|
{
|