Codechange: Replace FOR_ALL_ENGINES with range-based for loops

This commit is contained in:
glx
2019-12-15 22:45:18 +01:00
committed by Niels Martin Hansen
parent 1c92ba8ebe
commit 1f6b3a37f9
16 changed files with 50 additions and 81 deletions

View File

@@ -267,8 +267,7 @@ RailTypes GetCompanyRailtypes(CompanyID company, bool introduces)
{
RailTypes rts = RAILTYPES_NONE;
const Engine *e;
FOR_ALL_ENGINES_OF_TYPE(e, VEH_TRAIN) {
for (const Engine *e : Engine::IterateType(VEH_TRAIN)) {
const EngineInfo *ei = &e->info;
if (HasBit(ei->climates, _settings_game.game_creation.landscape) &&
@@ -299,8 +298,7 @@ RailTypes GetRailTypes(bool introduces)
{
RailTypes rts = RAILTYPES_NONE;
const Engine *e;
FOR_ALL_ENGINES_OF_TYPE(e, VEH_TRAIN) {
for (const Engine *e : Engine::IterateType(VEH_TRAIN)) {
const EngineInfo *ei = &e->info;
if (!HasBit(ei->climates, _settings_game.game_creation.landscape)) continue;