From 522e5ec86bd9b216e09549ca1d5aba0378e8a95a Mon Sep 17 00:00:00 2001 From: frosch Date: Fri, 25 May 2012 20:57:36 +0000 Subject: (svn r24277) -Codechange: Store cargo and railtype translation tables in a SmallVector. --- src/newgrf_cargo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/newgrf_cargo.cpp') diff --git a/src/newgrf_cargo.cpp b/src/newgrf_cargo.cpp index f9da37e7b..0c48273cc 100644 --- a/src/newgrf_cargo.cpp +++ b/src/newgrf_cargo.cpp @@ -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); -- cgit v1.2.3-54-g00ecf