summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2019-12-17 03:37:43 +0100
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-12-21 20:13:03 +0100
commitd8a1be48cd60c690235de175e9a044b95f92ea28 (patch)
tree2e1481aa11661c28df49f0d62f56fbf730577152 /src/openttd.cpp
parent9892d90b26db4dfe97ec7baeb89e43acb53a178e (diff)
downloadopenttd-d8a1be48cd60c690235de175e9a044b95f92ea28.tar.xz
Codechange: Replace vehicle related FOR_ALL with range-based for loops
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index cf79419cc..63d5bf756 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -1230,8 +1230,7 @@ static void CheckCaches()
rs->GetEntry(DIAGDIR_NW)->CheckIntegrity(rs);
}
- Vehicle *v;
- FOR_ALL_VEHICLES(v) {
+ for (Vehicle *v : Vehicle::Iterate()) {
extern void FillNewGRFVehicleCache(const Vehicle *v);
if (v != v->First() || v->vehstatus & VS_CRASHED || !v->IsPrimaryVehicle()) continue;
@@ -1306,7 +1305,7 @@ static void CheckCaches()
}
/* Check whether the caches are still valid */
- FOR_ALL_VEHICLES(v) {
+ for (Vehicle *v : Vehicle::Iterate()) {
byte buff[sizeof(VehicleCargoList)];
memcpy(buff, &v->cargo, sizeof(VehicleCargoList));
v->cargo.InvalidateCache();