Codechange: Replace vehicle related FOR_ALL with range-based for loops
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user