summaryrefslogtreecommitdiff
path: root/src/company_gui.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2019-12-15 22:45:18 +0100
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-12-21 20:13:03 +0100
commit1f6b3a37f9c39adb22eb61d3153b0c62bfa20551 (patch)
tree15486a7d6bb1445f3d6f1cbf40f98c1552368c08 /src/company_gui.cpp
parent1c92ba8ebed55e5455d6f57508db8ce55071d6eb (diff)
downloadopenttd-1f6b3a37f9c39adb22eb61d3153b0c62bfa20551.tar.xz
Codechange: Replace FOR_ALL_ENGINES with range-based for loops
Diffstat (limited to 'src/company_gui.cpp')
-rw-r--r--src/company_gui.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index c09dab139..92c6ccb53 100644
--- a/src/company_gui.cpp
+++ b/src/company_gui.cpp
@@ -1825,8 +1825,7 @@ struct CompanyInfrastructureWindow : Window
this->roadtypes = ROADTYPES_NONE;
/* Find the used railtypes. */
- Engine *e;
- FOR_ALL_ENGINES_OF_TYPE(e, VEH_TRAIN) {
+ for (const Engine *e : Engine::IterateType(VEH_TRAIN)) {
if (!HasBit(e->info.climates, _settings_game.game_creation.landscape)) continue;
this->railtypes |= GetRailTypeInfo(e->u.rail.railtype)->introduces_railtypes;
@@ -1836,7 +1835,7 @@ struct CompanyInfrastructureWindow : Window
this->railtypes = AddDateIntroducedRailTypes(this->railtypes, MAX_DAY);
/* Find the used roadtypes. */
- FOR_ALL_ENGINES_OF_TYPE(e, VEH_ROAD) {
+ for (const Engine *e : Engine::IterateType(VEH_ROAD)) {
if (!HasBit(e->info.climates, _settings_game.game_creation.landscape)) continue;
this->roadtypes |= GetRoadTypeInfo(e->u.road.roadtype)->introduces_roadtypes;