(svn r24277) -Codechange: Store cargo and railtype translation tables in a SmallVector.

This commit is contained in:
frosch
2012-05-25 20:57:36 +00:00
parent b8f6b300d6
commit 522e5ec86b
4 changed files with 26 additions and 38 deletions

View File

@@ -116,10 +116,10 @@ CargoID GetCargoTranslation(uint8 cargo, const GRFFile *grffile, bool usebit)
/* Other cases use (possibly translated) cargobits */
if (grffile->cargo_max > 0) {
if (grffile->cargo_list.Length() > 0) {
/* ...and the cargo is in bounds, then get the cargo ID for
* the label */
if (cargo < grffile->cargo_max) return GetCargoIDByLabel(grffile->cargo_list[cargo]);
if (cargo < grffile->cargo_list.Length()) return GetCargoIDByLabel(grffile->cargo_list[cargo]);
} else {
/* Else the cargo value is a 'climate independent' 'bitnum' */
return GetCargoIDByBitnum(cargo);