diff options
Diffstat (limited to 'src/script/api/script_cargo.cpp')
-rw-r--r-- | src/script/api/script_cargo.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/script/api/script_cargo.cpp b/src/script/api/script_cargo.cpp index e8268b6bb..b2459af4e 100644 --- a/src/script/api/script_cargo.cpp +++ b/src/script/api/script_cargo.cpp @@ -13,6 +13,7 @@ #include "script_cargo.hpp" #include "../../economy_func.h" #include "../../core/bitmath_func.hpp" +#include "../../settings_type.h" /* static */ bool ScriptCargo::IsValidCargo(CargoID cargo_type) { @@ -64,3 +65,9 @@ if (!IsValidCargo(cargo_type)) return -1; return ::GetTransportedGoodsIncome(1, distance, Clamp(days_in_transit * 2 / 5, 0, 255), cargo_type); } + +/* static */ ScriptCargo::DistributionType ScriptCargo::GetDistributionType(CargoID cargo_type) +{ + if (!ScriptCargo::IsValidCargo(cargo_type)) return INVALID_DISTRIBUTION_TYPE; + return (ScriptCargo::DistributionType)_settings_game.linkgraph.GetDistributionType(cargo_type); +}
\ No newline at end of file |