MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetCargoProduction

Method GetCargoProduction

src/script/api/script_tile.cpp:242–248  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

240}
241
242/* static */ SQInteger ScriptTile::GetCargoProduction(TileIndex tile, CargoType cargo_type, SQInteger width, SQInteger height, SQInteger radius)
243{
244 if (!::IsValidTile(tile) || width <= 0 || height <= 0 || radius < 0 || !ScriptCargo::IsValidCargo(cargo_type)) return -1;
245
246 CargoArray produced = ::GetProductionAroundTiles(tile, width, height, _settings_game.station.modified_catchment ? radius : (int)CA_UNMODIFIED);
247 return produced[cargo_type];
248}
249
250/* static */ SQInteger ScriptTile::GetDistanceManhattanToTile(TileIndex tile_from, TileIndex tile_to)
251{

Callers

nothing calls this directly

Calls 2

IsValidTileFunction · 0.85
GetProductionAroundTilesFunction · 0.85

Tested by

no test coverage detected