diff options
author | glx <glx@openttd.org> | 2019-12-15 22:45:18 +0100 |
---|---|---|
committer | Niels Martin Hansen <nielsm@indvikleren.dk> | 2019-12-21 20:13:03 +0100 |
commit | 1f6b3a37f9c39adb22eb61d3153b0c62bfa20551 (patch) | |
tree | 15486a7d6bb1445f3d6f1cbf40f98c1552368c08 /src/elrail.cpp | |
parent | 1c92ba8ebed55e5455d6f57508db8ce55071d6eb (diff) | |
download | openttd-1f6b3a37f9c39adb22eb61d3153b0c62bfa20551.tar.xz |
Codechange: Replace FOR_ALL_ENGINES with range-based for loops
Diffstat (limited to 'src/elrail.cpp')
-rw-r--r-- | src/elrail.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/elrail.cpp b/src/elrail.cpp index b169479da..eacb21f24 100644 --- a/src/elrail.cpp +++ b/src/elrail.cpp @@ -599,8 +599,7 @@ bool SettingsDisableElrail(int32 p1) const RailType new_railtype = disable ? RAILTYPE_RAIL : RAILTYPE_ELECTRIC; /* walk through all train engines */ - Engine *e; - FOR_ALL_ENGINES_OF_TYPE(e, VEH_TRAIN) { + for (Engine *e : Engine::IterateType(VEH_TRAIN)) { RailVehicleInfo *rv_info = &e->u.rail; /* if it is an electric rail engine and its railtype is the wrong one */ if (rv_info->engclass == 2 && rv_info->railtype == old_railtype) { |