summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorglx22 <glx@openttd.org>2021-04-30 17:01:26 +0200
committerLoïc Guilloux <glx22@users.noreply.github.com>2021-05-03 19:46:57 +0200
commit2feb801e56f5f36121bcc44d04cb46937987c490 (patch)
tree4ca88e9a3e2a917e489cb86cd80e230eb2bdafeb /src/saveload
parent983c7ade60f82a49d8c23c1f295add1fd9a913b0 (diff)
downloadopenttd-2feb801e56f5f36121bcc44d04cb46937987c490.tar.xz
Codechange: Replace FOR_ALL_ROADTRAMTYPES with range-based for loops
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/afterload.cpp2
-rw-r--r--src/saveload/company_sl.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index 56680511c..7fd220494 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -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);
diff --git a/src/saveload/company_sl.cpp b/src/saveload/company_sl.cpp
index fb2742a18..5770f9791 100644
--- a/src/saveload/company_sl.cpp
+++ b/src/saveload/company_sl.cpp
@@ -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));