summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
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();