summaryrefslogtreecommitdiff
path: root/src/ai/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/ai/api')
-rw-r--r--src/ai/api/ai_tile.cpp8
-rw-r--r--src/ai/api/ai_tilelist.cpp12
2 files changed, 10 insertions, 10 deletions
diff --git a/src/ai/api/ai_tile.cpp b/src/ai/api/ai_tile.cpp
index df44cac66..c7f67f603 100644
--- a/src/ai/api/ai_tile.cpp
+++ b/src/ai/api/ai_tile.cpp
@@ -179,16 +179,16 @@
{
if (!::IsValidTile(tile) || width <= 0 || height <= 0 || radius <= 0) return -1;
- AcceptedCargo accepts;
- ::GetAcceptanceAroundTiles(accepts, tile, width, height, _settings_game.station.modified_catchment ? radius : (int)CA_UNMODIFIED);
- return accepts[cargo_type];
+ CargoArray acceptance;
+ ::GetAcceptanceAroundTiles(acceptance, tile, width, height, _settings_game.station.modified_catchment ? radius : (int)CA_UNMODIFIED);
+ return acceptance[cargo_type];
}
/* static */ int32 AITile::GetCargoProduction(TileIndex tile, CargoID cargo_type, int width, int height, int radius)
{
if (!::IsValidTile(tile) || width <= 0 || height <= 0 || radius <= 0) return -1;
- AcceptedCargo produced;
+ CargoArray produced;
::GetProductionAroundTiles(produced, tile, width, height, _settings_game.station.modified_catchment ? radius : (int)CA_UNMODIFIED);
return produced[cargo_type];
}
diff --git a/src/ai/api/ai_tilelist.cpp b/src/ai/api/ai_tilelist.cpp
index 8015b96f8..38b99ef9a 100644
--- a/src/ai/api/ai_tilelist.cpp
+++ b/src/ai/api/ai_tilelist.cpp
@@ -92,12 +92,12 @@ AITileList_IndustryAccepting::AITileList_IndustryAccepting(IndustryID industry_i
/* Only add the tile if it accepts the cargo (sometimes just 1 tile of an
* industry triggers the acceptance). */
- AcceptedCargo accepts;
- ::GetAcceptanceAroundTiles(accepts, cur_tile, 1, 1, radius);
+ CargoArray acceptance;
+ ::GetAcceptanceAroundTiles(acceptance, cur_tile, 1, 1, radius);
{
bool cargo_accepts = false;
for (byte j = 0; j < lengthof(i->accepts_cargo); j++) {
- if (i->accepts_cargo[j] != CT_INVALID && accepts[i->accepts_cargo[j]] != 0) cargo_accepts = true;
+ if (i->accepts_cargo[j] != CT_INVALID && acceptance[i->accepts_cargo[j]] != 0) cargo_accepts = true;
}
if (!cargo_accepts) continue;
}
@@ -130,12 +130,12 @@ AITileList_IndustryProducing::AITileList_IndustryProducing(IndustryID industry_i
/* Only add the tile if it produces the cargo (a bug in OpenTTD makes this
* inconsitance). */
- AcceptedCargo produces;
- ::GetProductionAroundTiles(produces, cur_tile, 1, 1, radius);
+ CargoArray produced;
+ ::GetProductionAroundTiles(produced, cur_tile, 1, 1, radius);
{
bool cargo_produces = false;
for (byte j = 0; j < lengthof(i->produced_cargo); j++) {
- if (i->produced_cargo[j] != CT_INVALID && produces[i->produced_cargo[j]] != 0) cargo_produces = true;
+ if (i->produced_cargo[j] != CT_INVALID && produced[i->produced_cargo[j]] != 0) cargo_produces = true;
}
if (!cargo_produces) continue;
}