summaryrefslogtreecommitdiff
path: root/src/autoreplace_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/autoreplace_cmd.cpp')
-rw-r--r--src/autoreplace_cmd.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp
index 6bcab4ca5..25759b20c 100644
--- a/src/autoreplace_cmd.cpp
+++ b/src/autoreplace_cmd.cpp
@@ -171,7 +171,12 @@ static int32 ReplaceVehicle(Vehicle **w, byte flags, int32 total_cost)
return cost;
}
- if (replacement_cargo_type != CT_NO_REFIT) cost += GetRefitCost(new_engine_type); // add refit cost
+ if (replacement_cargo_type != CT_NO_REFIT) {
+ /* add refit cost */
+ int32 refit_cost = GetRefitCost(new_engine_type);
+ if (old_v->type == VEH_TRAIN && IsMultiheaded(old_v)) refit_cost += refit_cost; // pay for both ends
+ cost += refit_cost;
+ }
if (flags & DC_EXEC) {
new_v = GetVehicle(_new_vehicle_id);