summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-08-09 16:42:55 +0000
committerfrosch <frosch@openttd.org>2008-08-09 16:42:55 +0000
commit731685cf64088360f7bd7212b40b75a88c9059c1 (patch)
treeb655a2530d5a286ec71faf2af6a92b1f25ab016d
parent92afb4d9bda13d676693768c2fa389f3f39cb5ec (diff)
downloadopenttd-731685cf64088360f7bd7212b40b75a88c9059c1.tar.xz
(svn r14031) -Fix (r13850): Determining the refit cargo did not work, when the old vehicle did not carry anything but the new one did.
-rw-r--r--src/autoreplace_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp
index 1a8ac4393..f4c7c9c81 100644
--- a/src/autoreplace_cmd.cpp
+++ b/src/autoreplace_cmd.cpp
@@ -123,7 +123,7 @@ static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type)
/* Do we have to refit the vehicle, or is it already carrying the right cargo? */
uint16 *default_capacity = GetCapacityOfArticulatedParts(engine_type, v->type);
for (CargoID cid = 0; cid < NUM_CARGO; cid++) {
- if (cid != cargo_type && default_capacity[cid] > 0) return cargo_type;
+ if (cid != v->cargo_type && default_capacity[cid] > 0) return v->cargo_type;
}
return CT_NO_REFIT;