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.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp
index a1290532a..c457b0f19 100644
--- a/src/build_vehicle_gui.cpp
+++ b/src/build_vehicle_gui.cpp
@@ -1260,8 +1260,7 @@ struct BuildVehicleWindow : Window {
* Also check to see if the previously selected engine is still available,
* and if not, reset selection to INVALID_ENGINE. This could be the case
* when engines become obsolete and are removed */
- const Engine *e;
- FOR_ALL_ENGINES_OF_TYPE(e, VEH_TRAIN) {
+ for (const Engine *e : Engine::IterateType(VEH_TRAIN)) {
if (!this->show_hidden_engines && e->IsHidden(_local_company)) continue;
EngineID eid = e->index;
const RailVehicleInfo *rvi = &e->u.rail;
@@ -1304,8 +1303,7 @@ struct BuildVehicleWindow : Window {
this->eng_list.clear();
- const Engine *e;
- FOR_ALL_ENGINES_OF_TYPE(e, VEH_ROAD) {
+ for (const Engine *e : Engine::IterateType(VEH_ROAD)) {
if (!this->show_hidden_engines && e->IsHidden(_local_company)) continue;
EngineID eid = e->index;
if (!IsEngineBuildable(eid, VEH_ROAD, _local_company)) continue;
@@ -1324,8 +1322,7 @@ struct BuildVehicleWindow : Window {
EngineID sel_id = INVALID_ENGINE;
this->eng_list.clear();
- const Engine *e;
- FOR_ALL_ENGINES_OF_TYPE(e, VEH_SHIP) {
+ for (const Engine *e : Engine::IterateType(VEH_SHIP)) {
if (!this->show_hidden_engines && e->IsHidden(_local_company)) continue;
EngineID eid = e->index;
if (!IsEngineBuildable(eid, VEH_SHIP, _local_company)) continue;
@@ -1349,8 +1346,7 @@ struct BuildVehicleWindow : Window {
* Also check to see if the previously selected plane is still available,
* and if not, reset selection to INVALID_ENGINE. This could be the case
* when planes become obsolete and are removed */
- const Engine *e;
- FOR_ALL_ENGINES_OF_TYPE(e, VEH_AIRCRAFT) {
+ for (const Engine *e : Engine::IterateType(VEH_AIRCRAFT)) {
if (!this->show_hidden_engines && e->IsHidden(_local_company)) continue;
EngineID eid = e->index;
if (!IsEngineBuildable(eid, VEH_AIRCRAFT, _local_company)) continue;