summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
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/station_cmd.cpp
parent983c7ade60f82a49d8c23c1f295add1fd9a913b0 (diff)
downloadopenttd-2feb801e56f5f36121bcc44d04cb46937987c490.tar.xz
Codechange: Replace FOR_ALL_ROADTRAMTYPES with range-based for loops
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 451dedbad..39efb710e 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2029,7 +2029,7 @@ static CommandCost RemoveRoadStop(TileIndex tile, DoCommandFlag flags)
}
/* Update company infrastructure counts. */
- FOR_ALL_ROADTRAMTYPES(rtt) {
+ for (RoadTramType rtt : _roadtramtypes) {
RoadType rt = GetRoadType(tile, rtt);
UpdateCompanyRoadInfrastructure(rt, GetRoadOwner(tile, rtt), -static_cast<int>(ROAD_STOP_TRACKBIT_FACTOR));
}
@@ -2110,7 +2110,7 @@ CommandCost CmdRemoveRoadStop(TileIndex tile, DoCommandFlag flags, uint32 p1, ui
RoadType road_type[] = { INVALID_ROADTYPE, INVALID_ROADTYPE };
Owner road_owner[] = { OWNER_NONE, OWNER_NONE };
if (IsDriveThroughStopTile(cur_tile)) {
- FOR_ALL_ROADTRAMTYPES(rtt) {
+ for (RoadTramType rtt : _roadtramtypes) {
road_type[rtt] = GetRoadType(cur_tile, rtt);
if (road_type[rtt] == INVALID_ROADTYPE) continue;
road_owner[rtt] = GetRoadOwner(cur_tile, rtt);
@@ -4178,7 +4178,7 @@ void DeleteOilRig(TileIndex tile)
static void ChangeTileOwner_Station(TileIndex tile, Owner old_owner, Owner new_owner)
{
if (IsRoadStopTile(tile)) {
- FOR_ALL_ROADTRAMTYPES(rtt) {
+ for (RoadTramType rtt : _roadtramtypes) {
/* Update all roadtypes, no matter if they are present */
if (GetRoadOwner(tile, rtt) == old_owner) {
RoadType rt = GetRoadType(tile, rtt);