diff --git a/src/economy.cpp b/src/economy.cpp --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1899,12 +1899,9 @@ void LoadUnloadStation(Station *st) if (st->loading_vehicles.empty()) return; Vehicle *last_loading = nullptr; - std::list::iterator iter; /* Check if anything will be loaded at all. Otherwise we don't need to reserve either. */ - for (iter = st->loading_vehicles.begin(); iter != st->loading_vehicles.end(); ++iter) { - Vehicle *v = *iter; - + for (Vehicle *v : st->loading_vehicles) { if ((v->vehstatus & (VS_STOPPED | VS_CRASHED))) continue; assert(v->load_unload_ticks != 0); @@ -1920,8 +1917,7 @@ void LoadUnloadStation(Station *st) */ if (last_loading == nullptr) return; - for (iter = st->loading_vehicles.begin(); iter != st->loading_vehicles.end(); ++iter) { - Vehicle *v = *iter; + for (Vehicle *v : st->loading_vehicles) { if (!(v->vehstatus & (VS_STOPPED | VS_CRASHED))) LoadUnloadVehicle(v); if (v == last_loading) break; }