(svn r23487) -Change/Fix: Make autoreplace, autorenew, cloning and autorefit check all articulated parts of a vehicle to find a shared cargo subtype.

This commit is contained in:
frosch
2011-12-10 21:09:21 +00:00
parent 43fbfa2414
commit e83fa1da5b
4 changed files with 61 additions and 71 deletions

View File

@@ -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);