summaryrefslogtreecommitdiff
path: root/src/autoreplace_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/autoreplace_cmd.cpp')
-rw-r--r--src/autoreplace_cmd.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp
index 4b444ae19..e3639742f 100644
--- a/src/autoreplace_cmd.cpp
+++ b/src/autoreplace_cmd.cpp
@@ -179,9 +179,8 @@ static bool VerifyAutoreplaceRefitForOrders(const Vehicle *v, EngineID engine_ty
CargoTypes union_refit_mask_a = GetUnionOfArticulatedRefitMasks(v->engine_type, false);
CargoTypes union_refit_mask_b = GetUnionOfArticulatedRefitMasks(engine_type, false);
- const Order *o;
const Vehicle *u = (v->type == VEH_TRAIN) ? v->First() : v;
- FOR_VEHICLE_ORDERS(u, o) {
+ for (const Order *o : u->Orders()) {
if (!o->IsRefit() || o->IsAutoRefit()) continue;
CargoID cargo_type = o->GetRefitCargo();