diff options
author | glx22 <glx@openttd.org> | 2021-04-30 17:01:26 +0200 |
---|---|---|
committer | Loïc Guilloux <glx22@users.noreply.github.com> | 2021-05-03 19:46:57 +0200 |
commit | 2feb801e56f5f36121bcc44d04cb46937987c490 (patch) | |
tree | 4ca88e9a3e2a917e489cb86cd80e230eb2bdafeb /src/road_cmd.cpp | |
parent | 983c7ade60f82a49d8c23c1f295add1fd9a913b0 (diff) | |
download | openttd-2feb801e56f5f36121bcc44d04cb46937987c490.tar.xz |
Codechange: Replace FOR_ALL_ROADTRAMTYPES with range-based for loops
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r-- | src/road_cmd.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 830f9dd4f..82e944f6e 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -1238,7 +1238,7 @@ static CommandCost ClearTile_Road(TileIndex tile, DoCommandFlag flags) /* Clear the road if only one piece is on the tile OR we are not using the DC_AUTO flag */ if ((HasExactlyOneBit(b) && GetRoadBits(tile, RTT_TRAM) == ROAD_NONE) || !(flags & DC_AUTO)) { CommandCost ret(EXPENSES_CONSTRUCTION); - FOR_ALL_ROADTRAMTYPES(rtt) { + for (RoadTramType rtt : _roadtramtypes) { if (!MayHaveRoad(tile) || GetRoadType(tile, rtt) == INVALID_ROADTYPE) continue; CommandCost tmp_ret = RemoveRoad(tile, flags, GetRoadBits(tile, rtt), rtt, true); @@ -2203,7 +2203,7 @@ static void ChangeTileOwner_Road(TileIndex tile, Owner old_owner, Owner new_owne Company::Get(new_owner)->infrastructure.road[rt] += 2; SetTileOwner(tile, new_owner); - FOR_ALL_ROADTRAMTYPES(rtt) { + for (RoadTramType rtt : _roadtramtypes) { if (GetRoadOwner(tile, rtt) == old_owner) { SetRoadOwner(tile, rtt, new_owner); } @@ -2213,7 +2213,7 @@ static void ChangeTileOwner_Road(TileIndex tile, Owner old_owner, Owner new_owne return; } - 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); |