diff options
author | smatz <smatz@openttd.org> | 2009-07-16 20:40:06 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-07-16 20:40:06 +0000 |
commit | 77d13eae6194387ca6ce2b0eb835b7f97f67d085 (patch) | |
tree | a15b28b9384b9590cf11866a877097709db4d89d /src/build_vehicle_gui.cpp | |
parent | 665fa7f9c170774f6a640ecf381f714b50b6b174 (diff) | |
download | openttd-77d13eae6194387ca6ce2b0eb835b7f97f67d085.tar.xz |
(svn r16852) -Codechange: use FOR_ALL_CARGOSPECS for iterating over all valid CargoSpecs
Diffstat (limited to 'src/build_vehicle_gui.cpp')
-rw-r--r-- | src/build_vehicle_gui.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 07443475b..bad9aa049 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -820,11 +820,10 @@ struct BuildVehicleWindow : Window { } /* Collect available cargo types for filtering */ - for (CargoID cid = 0; cid < NUM_CARGO; cid++) { - const CargoSpec *cargo = CargoSpec::Get(cid); - if (!cargo->IsValid()) continue; - if (IsCargoInClass(cid, CC_SPECIAL)) continue; // exclude fake cargo types - this->cargo_filter[filter_items] = cid; + const CargoSpec *cargo; + FOR_ALL_CARGOSPECS(cargo) { + if (IsCargoInClass(cargo->Index(), CC_SPECIAL)) continue; // exclude fake cargo types + this->cargo_filter[filter_items] = cargo->Index(); this->cargo_filter_texts[filter_items] = cargo->name; filter_items++; } |