summaryrefslogtreecommitdiff
path: root/src/build_vehicle_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/build_vehicle_gui.cpp')
-rw-r--r--src/build_vehicle_gui.cpp9
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++;
}