summaryrefslogtreecommitdiff
path: root/src/vehicle_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-12-10 21:09:21 +0000
committerfrosch <frosch@openttd.org>2011-12-10 21:09:21 +0000
commit2fe8e89a45c90a1bced09e8fbcfc7e5b526d54ed (patch)
tree5576200e898adcbae733dc9121423bc3ac281711 /src/vehicle_cmd.cpp
parenta8960f64be1a7796e90e2634fc2a5419e369f0b5 (diff)
downloadopenttd-2fe8e89a45c90a1bced09e8fbcfc7e5b526d54ed.tar.xz
(svn r23487) -Change/Fix: Make autoreplace, autorenew, cloning and autorefit check all articulated parts of a vehicle to find a shared cargo subtype.
Diffstat (limited to 'src/vehicle_cmd.cpp')
-rw-r--r--src/vehicle_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp
index 4293e5f75..146b81659 100644
--- a/src/vehicle_cmd.cpp
+++ b/src/vehicle_cmd.cpp
@@ -842,7 +842,7 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
assert(w != NULL);
/* Find out what's the best sub type */
- byte subtype = GetBestFittingSubType(v, w);
+ byte subtype = GetBestFittingSubType(v, w, v->cargo_type);
if (w->cargo_type != v->cargo_type || w->cargo_subtype != subtype) {
CommandCost cost = DoCommand(0, w->index, v->cargo_type | 1U << 7 | (subtype << 8), flags, GetCmdRefitVeh(v));
if (cost.Succeeded()) total_cost.AddCost(cost);