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
commit5bcf7de45a3cac393a1d797d2cb1923e93f8165b (patch)
treeb655a2530d5a286ec71faf2af6a92b1f25ab016d
parent3c2128dedba5c6c4e9687121951b07a9946bb355 (diff)
downloadopenttd-5bcf7de45a3cac393a1d797d2cb1923e93f8165b.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;