|
|
|
@ -175,21 +175,21 @@
|
|
|
|
|
return ::TrackStatusToTrackdirBits(::GetTileTrackStatus(tile, (::TransportType)transport_type, UINT32_MAX)) != TRACKDIR_BIT_NONE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* static */ int32 AITile::GetCargoAcceptance(TileIndex tile, CargoID cargo_type, uint width, uint height, uint radius)
|
|
|
|
|
/* static */ int32 AITile::GetCargoAcceptance(TileIndex tile, CargoID cargo_type, int width, int height, int radius)
|
|
|
|
|
{
|
|
|
|
|
if (!::IsValidTile(tile)) return false;
|
|
|
|
|
if (!::IsValidTile(tile) || width <= 0 || height <= 0 || radius <= 0) return -1;
|
|
|
|
|
|
|
|
|
|
AcceptedCargo accepts;
|
|
|
|
|
::GetAcceptanceAroundTiles(accepts, tile, width, height, _settings_game.station.modified_catchment ? radius : (uint)CA_UNMODIFIED);
|
|
|
|
|
::GetAcceptanceAroundTiles(accepts, tile, width, height, _settings_game.station.modified_catchment ? radius : (int)CA_UNMODIFIED);
|
|
|
|
|
return accepts[cargo_type];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* static */ int32 AITile::GetCargoProduction(TileIndex tile, CargoID cargo_type, uint width, uint height, uint radius)
|
|
|
|
|
/* static */ int32 AITile::GetCargoProduction(TileIndex tile, CargoID cargo_type, int width, int height, int radius)
|
|
|
|
|
{
|
|
|
|
|
if (!::IsValidTile(tile)) return false;
|
|
|
|
|
if (!::IsValidTile(tile) || width <= 0 || height <= 0 || radius <= 0) return -1;
|
|
|
|
|
|
|
|
|
|
AcceptedCargo produced;
|
|
|
|
|
::GetProductionAroundTiles(produced, tile, width, height, _settings_game.station.modified_catchment ? radius : (uint)CA_UNMODIFIED);
|
|
|
|
|
::GetProductionAroundTiles(produced, tile, width, height, _settings_game.station.modified_catchment ? radius : (int)CA_UNMODIFIED);
|
|
|
|
|
return produced[cargo_type];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|