Codechange: Replace FOR_ALL_ROADTRAMTYPES with range-based for loops
This commit is contained in:
@@ -1855,7 +1855,7 @@ bool AfterLoadGame()
|
||||
}
|
||||
} else if (IsTileType(t, MP_ROAD)) {
|
||||
/* works for all RoadTileType */
|
||||
FOR_ALL_ROADTRAMTYPES(rtt) {
|
||||
for (RoadTramType rtt : _roadtramtypes) {
|
||||
/* update even non-existing road types to update tile owner too */
|
||||
Owner o = GetRoadOwner(t, rtt);
|
||||
if (o < MAX_COMPANIES && !Company::IsValidID(o)) SetRoadOwner(t, rtt, OWNER_NONE);
|
||||
|
@@ -128,7 +128,7 @@ void AfterLoadCompanyStats()
|
||||
}
|
||||
|
||||
/* Iterate all present road types as each can have a different owner. */
|
||||
FOR_ALL_ROADTRAMTYPES(rtt) {
|
||||
for (RoadTramType rtt : _roadtramtypes) {
|
||||
RoadType rt = GetRoadType(tile, rtt);
|
||||
if (rt == INVALID_ROADTYPE) continue;
|
||||
c = Company::GetIfValid(IsRoadDepot(tile) ? GetTileOwner(tile) : GetRoadOwner(tile, rtt));
|
||||
@@ -151,7 +151,7 @@ void AfterLoadCompanyStats()
|
||||
case STATION_BUS:
|
||||
case STATION_TRUCK: {
|
||||
/* Iterate all present road types as each can have a different owner. */
|
||||
FOR_ALL_ROADTRAMTYPES(rtt) {
|
||||
for (RoadTramType rtt : _roadtramtypes) {
|
||||
RoadType rt = GetRoadType(tile, rtt);
|
||||
if (rt == INVALID_ROADTYPE) continue;
|
||||
c = Company::GetIfValid(GetRoadOwner(tile, rtt));
|
||||
@@ -209,7 +209,7 @@ void AfterLoadCompanyStats()
|
||||
|
||||
case TRANSPORT_ROAD: {
|
||||
/* Iterate all present road types as each can have a different owner. */
|
||||
FOR_ALL_ROADTRAMTYPES(rtt) {
|
||||
for (RoadTramType rtt : _roadtramtypes) {
|
||||
RoadType rt = GetRoadType(tile, rtt);
|
||||
if (rt == INVALID_ROADTYPE) continue;
|
||||
c = Company::GetIfValid(GetRoadOwner(tile, rtt));
|
||||
|
Reference in New Issue
Block a user