summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-03-22 23:32:24 +0000
committerpeter1138 <peter1138@openttd.org>2007-03-22 23:32:24 +0000
commit2f6a46632aaf0cef6deefe8285bc94e963f7e7a1 (patch)
treec1a6f31c92166ba9b741c4d8315b45787d6ffe8e /src
parent4d81a464e2683b7374424357335e6d2107c7bb48 (diff)
downloadopenttd-2f6a46632aaf0cef6deefe8285bc94e963f7e7a1.tar.xz
(svn r9412) -Fix (r8886): When looking up a cargo type by label skip disabled cargos
Diffstat (limited to 'src')
-rw-r--r--src/cargotype.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cargotype.cpp b/src/cargotype.cpp
index d89972c31..bea8edd65 100644
--- a/src/cargotype.cpp
+++ b/src/cargotype.cpp
@@ -64,6 +64,7 @@ bool CargoSpec::IsValid() const
CargoID GetCargoIDByLabel(CargoLabel cl)
{
for (CargoID c = 0; c < lengthof(_cargo); c++) {
+ if (_cargo[c].bitnum == INVALID_CARGO) continue;
if (_cargo[c].label == cl) return c;
}