From d8a1be48cd60c690235de175e9a044b95f92ea28 Mon Sep 17 00:00:00 2001 From: glx Date: Tue, 17 Dec 2019 03:37:43 +0100 Subject: Codechange: Replace vehicle related FOR_ALL with range-based for loops --- src/openttd.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/openttd.cpp') 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(); -- cgit v1.2.3-54-g00ecf