summaryrefslogtreecommitdiff
path: root/src/autoreplace_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-02-19 18:34:24 +0000
committerfrosch <frosch@openttd.org>2012-02-19 18:34:24 +0000
commit5167f2be29957bd96d06b0103f448b25a20691be (patch)
tree166a589e6c9b679be253b9703735cf536df1ae67 /src/autoreplace_cmd.cpp
parent3d6f8cd7d4ee6268c497e0f8217dce5e62e12177 (diff)
downloadopenttd-5167f2be29957bd96d06b0103f448b25a20691be.tar.xz
(svn r23965) -Fix [FS#5070]: Refittability should never depend on the current capacity of a vehicle.
Diffstat (limited to 'src/autoreplace_cmd.cpp')
-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 87ff69449..31bf75dee 100644
--- a/src/autoreplace_cmd.cpp
+++ b/src/autoreplace_cmd.cpp
@@ -206,7 +206,7 @@ static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type, bool
* now we will figure out what cargo the train is carrying and refit to fit this */
for (v = v->First(); v != NULL; v = v->Next()) {
- if (v->cargo_cap == 0) continue;
+ if (!v->GetEngine()->CanCarryCargo()) continue;
/* Now we found a cargo type being carried on the train and we will see if it is possible to carry to this one */
if (HasBit(available_cargo_types, v->cargo_type)) return v->cargo_type;
}