diff options
author | Patric Stout <truebrain@openttd.org> | 2021-01-09 15:15:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-09 15:15:14 +0100 |
commit | 218f40eea2227dddb2e3475f4f89d08ffd5c9c6f (patch) | |
tree | 444fda7b347d1d1651efa2a36251e2867cb3708f /src/script/api/script_cargo.hpp | |
parent | 3dbdb1c7e3d5b7561d87d2cf891809324064bc1c (diff) | |
download | openttd-218f40eea2227dddb2e3475f4f89d08ffd5c9c6f.tar.xz |
Add: [Script] ScriptCargo::GetName, to get the human readable name of a cargo (#8544)
Of course this translates into AICargo.GetName() for AIs and
GSCargo.GetName() for GameScripts.
Diffstat (limited to 'src/script/api/script_cargo.hpp')
-rw-r--r-- | src/script/api/script_cargo.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/script/api/script_cargo.hpp b/src/script/api/script_cargo.hpp index 9ecd4cbfb..1bfd8c553 100644 --- a/src/script/api/script_cargo.hpp +++ b/src/script/api/script_cargo.hpp @@ -85,6 +85,14 @@ public: static bool IsValidTownEffect(TownEffect towneffect_type); /** + * Get the name of the cargo type. + * @param cargo_type The cargo type to get the name of. + * @pre IsValidCargo(cargo_type). + * @return The name of the cargo type. + */ + static char *GetName(CargoID cargo_type); + + /** * Gets the string representation of the cargo label. * @param cargo_type The cargo to get the string representation of. * @pre ScriptCargo::IsValidCargo(cargo_type). |