summaryrefslogtreecommitdiff
path: root/src/autoreplace_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-04-06 07:07:21 +0000
committerrubidium <rubidium@openttd.org>2008-04-06 07:07:21 +0000
commit3edb967ecf7dbf17a4d7e98975cd99345ce5a3f9 (patch)
tree914d1e0005bd1676636f2860ef07b9137d189d14 /src/autoreplace_cmd.cpp
parent84e3fa75e1977375aafbd56219ac34a26f9f6d73 (diff)
downloadopenttd-3edb967ecf7dbf17a4d7e98975cd99345ce5a3f9.tar.xz
(svn r12586) -Codechange: do not access an order's refit variables directly.
Diffstat (limited to 'src/autoreplace_cmd.cpp')
-rw-r--r--src/autoreplace_cmd.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp
index 59dcbddc9..bb13c7374 100644
--- a/src/autoreplace_cmd.cpp
+++ b/src/autoreplace_cmd.cpp
@@ -71,9 +71,9 @@ static bool VerifyAutoreplaceRefitForOrders(const Vehicle *v, const EngineID eng
}
FOR_VEHICLE_ORDERS(u, o) {
- if (!(o->refit_cargo < NUM_CARGO)) continue;
- if (!CanRefitTo(v->engine_type, o->refit_cargo)) continue;
- if (!CanRefitTo(engine_type, o->refit_cargo)) return false;
+ if (!o->IsRefit()) continue;
+ if (!CanRefitTo(v->engine_type, o->GetRefitCargo())) continue;
+ if (!CanRefitTo(engine_type, o->GetRefitCargo())) return false;
}
return true;