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.
This commit is contained in:
Patric Stout
2021-01-09 15:15:14 +01:00
committed by GitHub
parent 3dbdb1c7e3
commit 218f40eea2
6 changed files with 38 additions and 1 deletions

View File

@@ -332,7 +332,8 @@ function Regression::Cargo()
for (local i = -1; i < 15; i++) {
print(" Cargo " + i);
print(" IsValidCargo(): " + AICargo.IsValidCargo(i));
print(" GetCargoLabel(): '" + AICargo.GetCargoLabel(i)+ "'");
print(" GetName(): '" + AICargo.GetName(i) + "'");
print(" GetCargoLabel(): '" + AICargo.GetCargoLabel(i) + "'");
print(" IsFreight(): " + AICargo.IsFreight(i));
print(" HasCargoClass(): " + AICargo.HasCargoClass(i, AICargo.CC_PASSENGERS));
print(" GetTownEffect(): " + AICargo.GetTownEffect(i));