diff options
-rw-r--r-- | src/rail.cpp | 5 | ||||
-rw-r--r-- | src/road.cpp | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/rail.cpp b/src/rail.cpp index 99119ce09..ab94cc04c 100644 --- a/src/rail.cpp +++ b/src/rail.cpp @@ -167,11 +167,12 @@ RailTypes GetPlayerRailtypes(PlayerID p) { RailTypes rt = RAILTYPES_NONE; - for (EngineID i = 0; i != TOTAL_NUM_ENGINES; i++) { + EngineID i; + FOR_ALL_ENGINEIDS_OF_TYPE(i, VEH_TRAIN) { const Engine* e = GetEngine(i); const EngineInfo *ei = EngInfo(i); - if (e->type == VEH_TRAIN && HasBit(ei->climates, _opt.landscape) && + if (HasBit(ei->climates, _opt.landscape) && (HasBit(e->player_avail, p) || _date >= e->intro_date + 365)) { const RailVehicleInfo *rvi = RailVehInfo(i); diff --git a/src/road.cpp b/src/road.cpp index 7fa9b4398..2a7241af1 100644 --- a/src/road.cpp +++ b/src/road.cpp @@ -96,11 +96,12 @@ RoadTypes GetPlayerRoadtypes(PlayerID p) { RoadTypes rt = ROADTYPES_NONE; - for (EngineID i = 0; i != TOTAL_NUM_ENGINES; i++) { + EngineID i; + FOR_ALL_ENGINEIDS_OF_TYPE(i, VEH_ROAD) { const Engine* e = GetEngine(i); const EngineInfo *ei = EngInfo(i); - if (e->type == VEH_ROAD && HasBit(ei->climates, _opt.landscape) && + if (HasBit(ei->climates, _opt.landscape) && (HasBit(e->player_avail, p) || _date >= e->intro_date + 365)) { SetBit(rt, HasBit(ei->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD); } |