(svn r8886) -Codechange: (NewGRF) Add (partial) cargo translation table support, applied to action 3s only.

This commit is contained in:
peter1138
2007-02-24 19:36:47 +00:00
parent 0cf5ebee79
commit a23b4594ed
4 changed files with 120 additions and 15 deletions

View File

@@ -75,3 +75,14 @@ bool CargoSpec::IsValid() const
{
return bitnum != INVALID_CARGO;
}
CargoID GetCargoIDByLabel(CargoLabel cl)
{
for (CargoID c = 0; c < lengthof(_cargo); c++) {
if (_cargo[c].label == cl) return c;
}
/* No matching label was found, so it is invalid */
return CT_INVALID;
}