summaryrefslogtreecommitdiff
path: root/src/elrail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/elrail.cpp')
-rw-r--r--src/elrail.cpp3
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) {