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

Method GetCargoAcceptance

src/script/api/script_tile.cpp:234–240  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

232}
233
234/* static */ SQInteger ScriptTile::GetCargoAcceptance(TileIndex tile, CargoType cargo_type, SQInteger width, SQInteger height, SQInteger radius)
235{
236 if (!::IsValidTile(tile) || width <= 0 || height <= 0 || radius < 0 || !ScriptCargo::IsValidCargo(cargo_type)) return -1;
237
238 CargoArray acceptance = ::GetAcceptanceAroundTiles(tile, width, height, _settings_game.station.modified_catchment ? radius : (int)CA_UNMODIFIED);
239 return acceptance[cargo_type];
240}
241
242/* static */ SQInteger ScriptTile::GetCargoProduction(TileIndex tile, CargoType cargo_type, SQInteger width, SQInteger height, SQInteger radius)
243{

Callers

nothing calls this directly

Calls 2

IsValidTileFunction · 0.85
GetAcceptanceAroundTilesFunction · 0.85

Tested by

no test coverage detected