diff options
author | frosch <frosch@openttd.org> | 2013-02-24 16:41:51 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2013-02-24 16:41:51 +0000 |
commit | 22bb015f3d1f172227a74cb6d9d0bc96378f452a (patch) | |
tree | a4172aa3b01136ea21375fcb88b70b72555dbbff /src/economy.cpp | |
parent | 205543f727b5a4e0084c1eceb433eac8fa0a327b (diff) | |
download | openttd-22bb015f3d1f172227a74cb6d9d0bc96378f452a.tar.xz |
(svn r25041) -Remove [FS#3764-ish]: ordered refit with subtypes, since the cases where it worked were corner cases rather than the general case.
Diffstat (limited to 'src/economy.cpp')
-rw-r--r-- | src/economy.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
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]; } |