summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfonsinchen <fonsinchen@openttd.org>2014-09-18 17:49:19 +0000
committerfonsinchen <fonsinchen@openttd.org>2014-09-18 17:49:19 +0000
commitdfbcd8869df0627dc5ff2ee83aed00bc323e740b (patch)
treef61bdb29c5e9c282908a5e894365f0ad46e6ac24 /src
parent5203a96c1231210a0ba101626a9c287a117d31ca (diff)
downloadopenttd-dfbcd8869df0627dc5ff2ee83aed00bc323e740b.tar.xz
(svn r26847) -Fix [FS#6110]: Don't assign a next hop when returning cargo
Diffstat (limited to 'src')
-rw-r--r--src/economy.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index e36e43147..44dceb1f2 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -1516,7 +1516,11 @@ static void HandleStationRefit(Vehicle *v, CargoArray &consist_capleft, Station
/* Refit if given a valid cargo. */
if (new_cid < NUM_CARGO && new_cid != v_start->cargo_type) {
- IterateVehicleParts(v_start, ReturnCargoAction(st, StationIDStack(next_station).Pop()));
+ /* INVALID_STATION because in the DT_MANUAL case that's correct and in the DT_(A)SYMMETRIC
+ * cases the next hop of the vehicle doesn't really tell us anything if the cargo had been
+ * "via any station" before reserving. We rather produce some more "any station" cargo than
+ * misrouting it. */
+ IterateVehicleParts(v_start, ReturnCargoAction(st, INVALID_STATION));
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()) v->First()->profit_this_year -= cost.GetCost() << 8;
}