From 22bb015f3d1f172227a74cb6d9d0bc96378f452a Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 24 Feb 2013 16:41:51 +0000 Subject: (svn r25041) -Remove [FS#3764-ish]: ordered refit with subtypes, since the cases where it worked were corner cases rather than the general case. --- src/economy.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/economy.cpp') diff --git a/src/economy.cpp b/src/economy.cpp index f4f3c3a08..e32ffa3dc 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1441,7 +1441,6 @@ static void LoadUnloadVehicle(Vehicle *front) (v->type != VEH_AIRCRAFT || (Aircraft::From(v)->IsNormalAircraft() && v->Next()->cargo.Count() == 0))) { Vehicle *v_start = v->GetFirstEnginePart(); CargoID new_cid = front->current_order.GetRefitCargo(); - byte new_subtype = front->current_order.GetRefitSubtype(); /* Remove old capacity from consist capacity */ consist_capleft[v_start->cargo_type] -= v_start->cargo_cap; @@ -1471,8 +1470,7 @@ static void LoadUnloadVehicle(Vehicle *front) if ((int)st->goods[cid].cargo.Count() > (int)consist_capleft[cid] + amount) { /* Try to find out if auto-refitting would succeed. In case the refit is allowed, * the returned refit capacity will be greater than zero. */ - new_subtype = GetBestFittingSubType(v, v, cid); - DoCommand(v_start->tile, v_start->index, cid | 1U << 6 | new_subtype << 8 | 1U << 16, DC_QUERY_COST, GetCmdRefitVeh(v_start)); // Auto-refit and only this vehicle including artic parts. + DoCommand(v_start->tile, v_start->index, cid | 1U << 6 | 0xFF << 8 | 1U << 16, DC_QUERY_COST, GetCmdRefitVeh(v_start)); // Auto-refit and only this vehicle including artic parts. if (_returned_refit_capacity > 0) { amount = st->goods[cid].cargo.Count() - consist_capleft[cid]; new_cid = cid; @@ -1483,7 +1481,7 @@ static void LoadUnloadVehicle(Vehicle *front) /* Refit if given a valid cargo. */ if (new_cid < NUM_CARGO) { - CommandCost cost = DoCommand(v_start->tile, v_start->index, new_cid | 1U << 6 | new_subtype << 8 | 1U << 16, DC_EXEC, GetCmdRefitVeh(v_start)); // Auto-refit and only this vehicle including artic parts. + CommandCost cost = DoCommand(v_start->tile, v_start->index, new_cid | 1U << 6 | 0xFF << 8 | 1U << 16, DC_EXEC, GetCmdRefitVeh(v_start)); // Auto-refit and only this vehicle including artic parts. if (cost.Succeeded()) front->profit_this_year -= cost.GetCost() << 8; ge = &st->goods[v->cargo_type]; } -- cgit v1.2.3-54-g00ecf