summaryrefslogtreecommitdiff
path: root/src/elrail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/elrail.cpp')
-rw-r--r--src/elrail.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/elrail.cpp b/src/elrail.cpp
index eacb21f24..1e35978af 100644
--- a/src/elrail.cpp
+++ b/src/elrail.cpp
@@ -591,7 +591,6 @@ void DrawRailCatenary(const TileInfo *ti)
bool SettingsDisableElrail(int32 p1)
{
- Train *t;
bool disable = (p1 != 0);
/* we will now walk through all electric train engines and change their railtypes if it is the wrong one*/
@@ -611,7 +610,7 @@ bool SettingsDisableElrail(int32 p1)
/* when disabling elrails, make sure that all existing trains can run on
* normal rail too */
if (disable) {
- FOR_ALL_TRAINS(t) {
+ for (Train *t : Train::Iterate()) {
if (t->railtype == RAILTYPE_ELECTRIC) {
/* this railroad vehicle is now compatible only with elrail,
* so add there also normal rail compatibility */
@@ -623,7 +622,7 @@ bool SettingsDisableElrail(int32 p1)
}
/* Fix the total power and acceleration for trains */
- FOR_ALL_TRAINS(t) {
+ for (Train *t : Train::Iterate()) {
/* power and acceleration is cached only for front engines */
if (t->IsFrontEngine()) {
t->ConsistChanged(CCF_TRACK);