(svn r24277) -Codechange: Store cargo and railtype translation tables in a SmallVector.
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user